3 Replies Latest reply on May 28, 2009 3:11 AM by tony.herstell1

    Date format in xhtml problem

    jzafrilla.tecnico.antswayofworking.es

      Hi all,
             
      I have two in dataTables my dataTable. Xhtml. Each table shows a list of items that containing a column of Date type.
      In both tables, i can receive the same record, and when this happens, the date is formatted correctly in only one of the tables, with the following format dd/MM/yyyyHH:mm,
      at the other table, date record lost the time(hours and minutes).


      Code:


      DataTable 1 and date column:




      <rich:dataTable
         id="ns_cnt_newList" var="ns_cnt_new"
         value="#{ns_cnt_newList.resultTracks)}"
         rendered="#{not empty ns_cnt_newList.resultTracks}"
         rowClasses="rvgRowOne,rvgRowTwo">
      
      <h:column >
         ...
         <h:outputText value="#{ns_cnt_new.ftpublish}">
              <s:convertDateTime type="both" pattern="dd/MM/yyyy HH:mm" />
         </h:outputText>
         ...
      </h:column>







      DataTable 2 and date column:




      <rich:dataTable
         id="ns_cnt_newList" var="ns_cnt_new"
         value="#{ns_cnt_newList.resultTracksB)}"
         rendered="#{not empty ns_cnt_newList.resultTracksB}"
         rowClasses="rvgRowOne,rvgRowTwo">
      
      <h:column >
         ...
         <h:outputText value="#{ns_cnt_new.ftpublish}">
              <s:convertDateTime type="both" pattern="dd/MM/yyyy HH:mm" />
         </h:outputText>
         ...
      </h:column>








      Thanks in advance

        • 1. Re: Date format in xhtml problem
          jzafrilla.tecnico.antswayofworking.es

          Sorry,


          Code of DataTable 2




          <rich:dataTable
             id="ns_cnt_newListB" var="ns_cnt_new"
             value="#{ns_cnt_newList.resultTracksB)}"
             rendered="#{not empty ns_cnt_newList.resultTracksB}"
             rowClasses="rvgRowOne,rvgRowTwo">
          
          <h:column >
             ...
             <h:outputText value="#{ns_cnt_new.ftpublish}">
                  <s:convertDateTime type="both" pattern="dd/MM/yyyy HH:mm" />
             </h:outputText>
             ...
          </h:column>



          • 2. Re: Date format in xhtml problem
            gonorrhea

            You need to compare the code for resultTracks and resultTracksB methods to see what they are actually returning in the debugger.


            Otherwise, your code for the dataTable instances looks identical and most likely the <s:converDateTime> tag is not your root cause.

            • 3. Re: Date format in xhtml problem
              tony.herstell1

              Richfaces have, in the latest snapshot (overnight), last Friday fixed a nasty bug with multiple tables on a single page (most notably similar tables inside a a4j:repeat loop). It fixed a lot of my issues as I can have upwards of 15 similar tables on a page (individual classes in a event)! Please try this bleeding edge release as one way of trying to clear you bug.


              I also have some email discussions with RF guy(s) to post into a thread on the RF forum with some useful code snippets supplied by them as one stops the sort of one table affecting all the tables on the page (when the tables are virtually identical).


              Hope its helpful.