Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

rich:dataTable is only showing header not Table record  RSS feed

 
ramamurthi mogilipalli
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  <rich:dataTable var="_log_kommun_fb" value="#{kommunProducer.singlekommunlog(kommunProducer.selected.kommun)}" id="kommunlogtable" styleClass="stable"> 
                                                      
                                                       <rich:column headerClass="listtable-subheadercell">
                                                              <f:facet name="header">Added_Date</f:facet>
                                                              <h:outputLabel value="#{_log_kommun_fb.addedDate}" >   
                                                                     <f:convertDateTime pattern="yyyy-MM-dd" />
                                                              </h:outputLabel>                                             
                                                       </rich:column>
                                                      
                                                         <rich:column headerClass="listtable-subheadercell">
                                                              <f:facet name="header">Changed_Date</f:facet>
                                                              <h:outputLabel value="#{_log_kommun_fb.changedDate}">  
                                                                     <f:convertDateTime pattern="yyyy-MM-dd" />
                                                              </h:outputLabel>                                             
                                                       </rich:column>
                                                      
                                                      
                                                      
                                  </rich:dataTable>   
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Ramamurthi!

The "value=" attribute of the rich:dataTable should not be a method call, it should be a reference to a backing bean property. That property should be of type javax.faces.DataModel or something such as an Array, List or other ordered collection that can be wrapped in a DataModel.

Also, the convention for J2EE object names (including JSF backing beans) is that the bean name should start with a lowercase letter. An underscore not only violates that convention, it can potentially cause the application to work improperly.
 
ramamurthi mogilipalli
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<rich:dataTable var="_log_fb" value="#{ammvPrestandaListProducer.singleAddressFMO_log(singleAdressFMOControlBean.adress.punktId)}" id="adress_fb_leveransomr_changelog_table" > 
                                               
                                            <rich:column headerClass="listtable-subheadercell">
                                                       <f:facet name="header">Datum</f:facet>
                                                       <h:outputLabel value="#{_log_fb.actionDate}">  
                                                              <f:convertDateTime pattern="yyyy-MM-dd" />
                                                       </h:outputLabel>                                             
                                                </rich:column>
                                 
                                                <rich:column headerClass="listtable-subheadercell">
                                                       <f:facet name="header">Åtgärd</f:facet>
                                                       <h:outputLabel value="#{_log_fb.actionText}">
                                                       </h:outputLabel>
                                                </rich:column>
                          
                           </rich:dataTable>

i have used above code in some other page with method call and it's working fine.
 
ramamurthi mogilipalli
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.
<rich:dataTable var="_log_fb" value="#{ammvPrestandaListProducer.singleAddressFMO_log(singleAdressFMOControlBean.adress.punktId)}" id="adress_fb_leveransomr_changelog_table" > 
                                               
                                            <rich:column headerClass="listtable-subheadercell">
                                                       <f:facet name="header">Datum</f:facet>
                                                       <h:outputLabel value="#{_log_fb.actionDate}">  
                                                              <f:convertDateTime pattern="yyyy-MM-dd" />
                                                       </h:outputLabel>                                             
                                                </rich:column>
                                 
                                                <rich:column headerClass="listtable-subheadercell">
                                                       <f:facet name="header">Åtgärd</f:facet>
                                                       <h:outputLabel value="#{_log_fb.actionText}">
                                                       </h:outputLabel>
                                                </rich:column>
                          
                           </rich:dataTable>

i have used above code in some other page with method call and it's working fine.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid "It's working fine" doesn't mean anything when you violate standards.

Not every standards violation causes instant and catastrophic failure. Sometimes the offense can go for years working "just fine" and then explode catastrophically. I very nearly ended up in Chicago at 3 a.m. once because of that, in fact.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!