2 Replies Latest reply on Apr 16, 2009 8:00 PM by Arbi Sookazian

    Some data is not rendering in dataTable

    Arbi Sookazian Master

      Seam 2.0.2-FP


      .xhtml:


      <a4j:form id="editParamFormTest">        
                              <rich:dataTable value="#{populateParametersList}" var="param">                    
                                       
                                              <rich:column>
                                                      <f:facet name="header"><h:outputText value="row count"/></f:facet>    
                                                      <h:outputText value="#{populateParametersList.getRowCount()}"/>
                                              </rich:column>
                                              <rich:column>
                                                      <f:facet name="header"><h:outputText value="Hierarchy"/></f:facet>    
                                                      <h:outputText value="#{param[0].caption}"/>
                                              </rich:column>
                                              <rich:column>
                                                      <f:facet name="header"><h:outputText value="Hierarchy"/></f:facet>    
                                                      <h:inputText value="#{param[1].paramValue}"/>
                                              </rich:column>
                                              <rich:column>
                                                      <f:facet name="header"><h:outputText value="Hierarchy"/></f:facet>    
                                                      <h:outputText value="#{param[0].dataType}"/>
                                              </rich:column>
                                                                                                                                      
                                                              
                              </rich:dataTable>                 
                      </a4j:form>



      relevant method from one of the entities in the List<Object[]> that is outjected via @DataModel:


      @Column(name = "Caption", length = 50)
              @Length(max = 50)
              public String getCaption() {
                      return this.caption;
              }



      SFSB:


      @Factory("populateParametersList")
              @SuppressWarnings("unchcecked")
              public void populateParameters(){
                      //testing
                                      
                      populateParametersList = entityManager.createQuery("select lpm, lvp "+
                                                                                                                              " from ListValue lv, ListValueParam lvp, ListParamMetaData lpm "+
                                                                                                                              " where lv.listValueId = lvp.listValue.listValueId "+
                                                                                                                              " and lv.list.listId = lpm.list.listId "+
                                                                                                                              " and lpm.paramName = lvp.paramName "+
                                                                                                                              " and lvp.listValue.listValueId = 4 "+
                                                                                                                              " and lv.list.listId = 2")
                                                                                                                              .getResultList();
                      
                      if (populateParametersList != null && populateParametersList.size() > 0) {
                              Object[] objArray1 = (Object[])populateParametersList.get(0);
                              Object[] objArray2 = (Object[])populateParametersList.get(1);
                              
                              ListParamMetaData lpm1 = (ListParamMetaData)objArray1[0];
                              ListValueParam lvp1 = (ListValueParam)objArray1[1];
                              
                              log.info("lpm1.caption = "+lpm1.getCaption());
                              log.info("lvp1.paramValue = "+lvp1.getParamValue());
                              log.info("lpm1.dataType = "+lpm1.getDataType());
                              
                              ListParamMetaData lpm2 = (ListParamMetaData)objArray2[0];
                              ListValueParam lvp2 = (ListValueParam)objArray2[1];
                              
                              log.info("lpm2.caption = "+lpm2.getCaption());
                              log.info("lvp2.paramValue = "+lvp2.getParamValue());
                              log.info("lpm2.dataType = "+lpm2.getDataType());
                      }
                                      
                      log.info("populateParametersList.size() = "+populateParametersList.size());
              }



      server.log:


      10:16:32,570 INFO  [ListManagementAction] lpm1.caption = Is Scheduled
      10:16:32,570 INFO  [ListManagementAction] lvp1.paramValue = 0
      10:16:32,570 INFO  [ListManagementAction] lpm1.dataType = BOOLEAN
      10:16:32,570 INFO  [ListManagementAction] lpm2.caption = Deduct from PTO
      10:16:32,570 INFO  [ListManagementAction] lvp2.paramValue = 1
      10:16:32,570 INFO  [ListManagementAction] lpm2.dataType = BOOLEAN
      10:16:32,570 INFO  [ListManagementAction] populateParametersList.size() = 2



      I'm seeing the headers (rowcount and the rest all hard-coded as Hierarchy for now).  I'm seeing the value 2 for rowcount column (which is correct).


      The other three cells are blank for both rows.  I added a breakpoint for the getCaption() method in one of the entities and it hits that line of code and there are the correct values that should be returned.


      Why is the data not displaying on the page???  I've been working on this for a while this morning but I hope it's something simple/stupid I'm missing...

        • 1. Re: Some data is not rendering in dataTable
          Arbi Sookazian Master

          I added this:


          <rich:column>
                                        <f:facet name="header"><h:outputText value="Hierarchy"/></f:facet>     
                                        <h:outputText value="#{param[99].dataTypeXXX}"/>
                                   </rich:column>



          to the dataTable and there was no exception thrown.  No affect other than adding another blank column (no data in the cells) to the end of the dataTable.

          • 2. Re: Some data is not rendering in dataTable
            Arbi Sookazian Master

            This must be a bug in Richfaces.


            I replaced 'param' with 'list' and now everything works as expected.


            I spent the entire morning on this.  There is no WARN level output from RF in the server.log.  The probability of another using 'param' for the var value is low but come on man.


            Throw an exception.  I've noticed RF skips or ignores other stuff as well (reRender an unknown/inexistant id, e.g.)


            That really sucked.