This content has been marked as final.
Show 2 replies
-
1. Re: How can I convert the pattern that the rich:calendar(richfaces 4.2.2) submits
jpapouse Jul 4, 2012 3:09 AM (in response to sabarinathsss)Hi,
in the managed bean you have a value of type Date, so the pattern doesn't make sense here. When I have the following code, everything works as expected. You have to use a converter when you print the date on the client side.
@ViewScoped @ManagedBean public class TestBean implements Serializable { private Date value; public static final TimeZone TIME_ZONE = TimeZone.getTimeZone("UTC"); public TimeZone getTimeZone() { return TIME_ZONE; } public Date getValue() { return value; } public void setValue(Date value) { this.value = value; } }
<h:form> <rich:calendar datePattern="MM/dd/yyyy" locale="en/US" value="#{testBean.value}" timeZone="#{testBean.timeZone}"> <a4j:ajax render="output"/> </rich:calendar> <br />Output: <h:outputText id="output" value="#{testBean.value}"> <f:convertDateTime pattern="MM/dd/yyyy" timeZone="#{testBean.timeZone}" /> </h:outputText> </h:form>
The full application is available on GitHub: https://github.com/papousek/richfaces-sanbox/tree/thread202093
-
2. Re: How can I convert the pattern that the rich:calendar(richfaces 4.2.2) submits
sabarinathsss Jul 4, 2012 3:11 AM (in response to jpapouse)Thanks for the reply
With Regards
S.Sabarinath