0

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>
Ingo Bürk
  • 19,263
  • 6
  • 66
  • 100
ovi
  • 11
  • 3

2 Answers2

1

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.

Community
  • 1
  • 1
peterremec
  • 488
  • 1
  • 15
  • 46
0

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>
ovi
  • 11
  • 3