Reputation: 11
I have a dataTable in JSF and in one column i must render a date. To view in page for a specific format I use a convertDateTime. The problem is when validationDate is loaded this value it is not converted for my pattern. Only the first value (stampoperation), if it is loaded, is converted for my pattern.
<t:dataTable value="#{ProductBean.viewByid}"
var="item" border="0" cellspacing="2" cellpadding="2"
width="100%" id="dtbl" headerClass="tableSotableHeader"
preserveDataModel="false"
rowClasses="rowOdd,rowEven">
<h:column>
<f:facet name="header">
<h:outputText value="State" />
</f:facet>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Data start" />
</f:facet>
**<h:outputText value="#{item.stampoperation}" rendered="#{item.status!=15}" >
<f:convertDateTime timeZone="#{UIBean.tz}" type="date" pattern="dd.MM.yyyy, HH:mm"/>
</h:outputText>
<h:outputText value="#{item.validDate}" rendered="#{item.status==15}">
<f:convertDateTime timeZone="#{UIBean.tz}" type="date" pattern="dd.MM.yyyy, HH:mm"/>
</h:outputText>**
</h:column>
</t:dataTable>
Upvotes: 0
Views: 704
Reputation: 11
Solved: I put values in a panel Group
<t:panelGroup id="x1"> <h:outputText value="#{item.stampoperation}" rendered="#{item.status!=15}" >
<f:convertDateTime timeZone="#{UIBean.tz}" type="date" pattern="dd.MM.yyyy, HH:mm"/>
</h:outputText>
<h:outputText value="#{item.validDate}" rendered="#{item.status==15}">
<f:convertDateTime timeZone="#{UIBean.tz}" type="date" pattern="dd.MM.yyyy, HH:mm"/>
</h:outputText> </t:panelGroup>
Upvotes: 0
Reputation: 516
There's a similar issue like in this question
When you dynamically display some component, it should be wrapped in a panelGroup and that panelGroup should have rendered attribute set.
Upvotes: 1