-
1. Re: How to add programmatically a dateFormat or dateConverter to a HtmlOutputText?
ealonso04 Jul 17, 2012 7:14 PM (in response to ealonso04)I tried this solution:
http://stackoverflow.com/questions/2086180/jsf-converter-property?rq=1
It worked for the dates I have inside tags, but not for the dates created at runtime as I said in the post above.
I created my own converter as the solution says:
public MyDateTimeConverter extends DateTimeConverter() {
public MyDateTimeConverter() {
setPattern("dd/MM/yyyy");
}
}
And I registered that one in faces-config:
<converter>
<converter-for-class>java.util.Date</converter-for-class>
<converter-class>com.example.MyDateTimeConverter</converter-class>
</converter>
Once again... this solution doesn't work for the HtmlOutputText generated programmatically at runtime.
-
2. Re: How to add programmatically a dateFormat or dateConverter to a HtmlOutputText?
mboukayoua Sep 3, 2012 2:54 AM (in response to ealonso04)Hi,
I have just resolve the same pb (with Number converter on Float column). You can try with "Date.class" as column type :
output.setValueExpression("value", createValueExpression("#{dynamicItem." + selectedColumns.get(i).getValue() + "}", Date.class));
instead of :
output.setValueExpression("value", createValueExpression("#{dynamicItem." + selectedColumns.get(i).getValue() + "}", String.class));