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
  • Report post to moderator
Table records are not showing.

<rich:panel  style="width:250px;height:350px;top:0;left:0;overflow:auto;border:none" >              
                                  <rich:dataTable var="_log_kommun_fb" value="#{kommunListProducer.logsList}" id="fiber_log_table" style="width: 100%"> 
                                                       <rich:column>
                                                              <f:facet name="header">
                                                              <h:outputText value="Added_Date"></h:outputText>
                                                              </f:facet>
                                                              <h:outputLabel value="#{_log_kommun_fb.addedDate}" >   
                                                                     <f:convertDateTime pattern="yyyy-MM-dd" />
                                                              </h:outputLabel>                                             
                                                       </rich:column>
                                                        
                                                         <rich:column>
                                                              <f:facet name="header">
                                                              <h:outputText value="Changed_Date"></h:outputText>
                                                              </f:facet>
                                                              <h:outputLabel value="#{_log_kommun_fb.changedDate}" > 
                                                                     <f:convertDateTime pattern="yyyy-MM-dd" />
                                                              </h:outputLabel>                                             
                                                       </rich:column>
                                                      
                                  </rich:dataTable>
                           </rich:panel>

-----------------
java code:
-------------------

public List<NfFiberKommunLog> getLogsList() {
              logsList = showlog();
              if(logsList!=null){
                     System.out.println("***************size:"+logsList.size());
              }
              return logsList;
       }



public List<NfFiberKommunLog> showlog() {
             
              if(selected!=null && selected.getKommun()!= null){
                     List<NfFiberKommunLog> logsList = null;
                     CriteriaBuilder builder = em.getCriteriaBuilder();
                     CriteriaQuery<NfFiberKommunLog> criteriaQuery = builder.createQuery(NfFiberKommunLog.class);
                     Root<NfFiberKommunLog> logRoot = criteriaQuery.from(NfFiberKommunLog.class);
                     criteriaQuery.select(logRoot);
                     System.out.println("********************name:"+selected.getKommun());
                     criteriaQuery.where(builder.equal(logRoot.get("kommun"),selected.getKommun()));  
                     logsList = em.createQuery(criteriaQuery).getResultList();
                     NfFiberKommunLog nfm  = null;
              for(int i=0;i<logsList.size(); i++){
                     
                      nfm = logsList.get(i);
                      System.out.println("i*********"+i+"kommun:***************"+nfm.getKommun()+"***************addedDate:"+nfm.getAddedDate()+"***************8changedDate:"+nfm.getChangedDate());
              }
              return logsList;       
              }
             
       }

console output:
15:32:06,828 INFO  [stdout] (http-127.0.0.1-127.0.0.1-8080-3) i*********0kommun:***************G÷teborg**********
*****addedDate:2016-08-01 12:11:35.0***************8changedDate:2016-08-01 12:11:35.0
15:32:06,829 INFO  [stdout] (http-127.0.0.1-127.0.0.1-8080-3) i*********1kommun:***************G÷teborg**********
*****addedDate:2016-08-01 12:11:35.0***************8changedDate:2016-08-01 12:11:35.0
15:32:06,830 INFO  [stdout] (http-127.0.0.1-127.0.0.1-8080-3) i*********2kommun:***************G÷teborg**********
*****addedDate:2016-08-01 12:11:35.0***************8changedDate:2016-08-01 12:11:35.0
15:32:06,830 INFO  [stdout] (http-127.0.0.1-127.0.0.1-8080-3) i*********3kommun:***************G÷teborg**********
*****addedDate:2016-08-01 12:11:35.0***************8changedDate:2016-08-01 12:11:35.0

 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
You asked this question 2 weeks ago. You didn't take my advice.

Please don't duplicate questions.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!