0 Replies Latest reply on Sep 30, 2012 6:32 AM by mimi grebici

    problem using <rich:extendedDataTable with sortBy  and  rendered

    mimi grebici Newbie

      Hi,

      I am using richfaces v3.3.2.

       

      I have this code in my jsp:

       

                     <h:selectOneMenu id="codifications"

                              value="#{findBean.codification}"

                              valueChangeListener="#{findBean.codificationChanged}">

                              <f:selectItems value="#{adminBean.codificationsList}" />

                              <a4j:support event="onchange" reRender="tableCodifications" />

                          </h:selectOneMenu>

       

       

       

      <rich:extendedDataTable id="tableCodifications" var="ligne" enableContextMenu="false"

              value="#{findBean.dataModel}"

              styleClass="recordSet"

              headerClass="recordSetHeader"

              rowClasses="recordSetRow, recordSetRowAlt"   width="1150px" height="400px" columnClasses="top, top"

              sortMode="single"

              selectionMode="single" align="center"

              >

       

          <rich:column id="codeType" style="text-align:center" 

                       sortable="true" sortBy="#{ligne.codeType}" width="170px"

                       rendered="#{findBean.codification==msg.label_codification_type_structure}">

              <f:facet name="header">

                  <h:outputText value="#{msg.label_input_code_codif}" />

              </f:facet>

              <f:verbatim>   </f:verbatim>

              <h:outputText value="#{ligne.codeType}" />

          </rich:column>

       

      <rich:column id="code" style="text-align:center" sortBy="#{ligne.code}" sortable="true"

              width="80px"

              rendered="#{findBean.codification==msg.label_codification_structure

                          || findBean.codification==msg.label_codification_sous_section

                          || findBean.codification==msg.label_codification_type_document}">

              <f:facet name="header">

                 <h:commandLink action="submit();" >

                  <h:outputText value="#{msg.label_input_code_codif}" />

                  </h:commandLink>

              </f:facet>

              <f:verbatim>   </f:verbatim>

              <h:outputText value="#{ligne.code}" />

          </rich:column>

       

      </rich:extendedDataTable>

       

       

      this is the behaviour:

       

      Supose we have diffent  values displayed in  <h:selectOneMenu id="codifications"  component . When you change the selected value there, the displayed column change (one of them is not rendered and the other one is rendered). Now, if you sort one column and change the selection (in  <h:selectOneMenu id="codifications"), and if you perform any action which return null or action with void signature, the element in the not rendered column is excecuted, and we have the exception :  org.apache.jasper.el.JspPropertyNotFoundException  about for example "ligne.codeType " because the column which displays this value is assumed not rendered.