2 Replies Latest reply on Feb 19, 2009 2:05 PM by saxenahemant

    Richfaces Migration issue: 3.2.x to 3.3.0 with datatable

    saxenahemant

      I have this html and backing bean which works in 3.2.x version but then, I am not sure what is the issue, the following thing wont work in 3.3.0:

      xhtml:

      <s:div style="width:950px; overflow-y:auto;">
       <rich:dataTable
       id="contCapacityList"
       value="#{resultTableDataModel.rows}"
       var="row"
       width="950"
       styleClass="resultList"
       rowClasses="first, second"
       rows="#{resultTableDataModel.resultTotal}"
       >
      
      
       <rich:columns
       value="#{resultTableDataModel.columns}"
       var="column"
       index="ind"
       sortBy="#{resultTableDataModel.findValue(row, column)}"
       rendered="#{resultTableDataModel.isSignificant(column)}"
       >
      

      bean:

      public boolean isSignificant(Column col) {
       boolean status = true;
       //Identity.instance().hasPermission("name", "action", null);
       if(col.getPropertyOfModel().equals(AdsTimeChunkCapacityModel.MODEL_PROPERTY_BOOKEDCOUNT)
       || col.getPropertyOfModel().equals(AdsTimeChunkCapacityModel.MODEL_PROPERTY_RESVCOUNT)
       ) {
       status = false;
       }
       else if(col.getPropertyOfModel().equals(AdsTimeChunkCapacityModel.MODEL_PROPERTY_AVAIL) && capacityOnlyMode) {
       // if UI is in show capacity only mode then there is no point showing Availability column
       status = false;
       }
      
       return status;
       }
      
      


      Problem: I start getting null value in isSignificant() method for parameter "col" when i switch to 3.3.0 richfaces version.

        • 1. Re: Richfaces Migration issue: 3.2.x to 3.3.0 with datatable

          Hello,

          Yes. This was broken since 3.3.0 GA.
          I added the issue: https://jira.jboss.org/jira/browse/RF-6267.
          Rendered attribute that uses columns var for evaluation now returns null value...

          But you can try workaround. Just return TRUE if passed paramer is null:

          public boolean isSignificant(Column col) {
          if (col == null) {
          return true;
          }
           boolean status = true;
           //Identity.instance().hasPermission("name", "action", null);
           if(col.getPropertyOfModel().equals(AdsTimeChunkCapacityModel.MODEL_PROPERTY_BOOKEDCOUNT)
           || col.getPropertyOfModel().equals(AdsTimeChunkCapacityModel.MODEL_PROPERTY_RESVCOUNT)
           ) {
           status = false;
           }
           else if(col.getPropertyOfModel().equals(AdsTimeChunkCapacityModel.MODEL_PROPERTY_AVAIL) && capacityOnlyMode) {
           // if UI is in show capacity only mode then there is no point showing Availability column
           status = false;
           }
          
           return status;
           }



          P.S. If you will detect that sorting failed after RF migration, please assign id for columns as:

          <rich:columns id="col#{ind}"
           value="#{resultTableDataModel.columns}"
           var="column" ....>



          Best regards




          • 2. Re: Richfaces Migration issue: 3.2.x to 3.3.0 with datatable
            saxenahemant

            Thanks for the prompt reply!!
            Just to verification i can return true for every column but that is not workaround. Doing that will make all column visible. Anways, I will wait for the fix.