Example:
<h:form>
<h:selectOneMenu value="#{bean.timezone}>
<f:selectItems value="#{bean.availableTimezones} ... >
<f:ajax render="currenttime" />
</h:selectOneMenu>
</h:form>
<h:form id="currenttime">
<h:outputText value="#{bean.currentTime}" >
<f:convertDateTime dateStyle="short" type="both" timeZone="#{bean.timezone}" />
</h:outputText>
</h:form>
<!-- bean.currentTime is of type 'Date' -->
In the example, changing the timezone should cause the text in currenttime
to show in the proper timezone. But it doesn't.
I figured this happens because converters are calculated in "Apply Request" phase and the value of the selected timezone is updated in "Update Model" phase.
Am I right? Should I not use converters for this?
Thanks!