4 Replies Latest reply on Apr 12, 2010 6:28 AM by nbelaevski

    After rich:extendedDataTable sortby,otheractions are not getting executed

      we  have several tabs and one of the tabs uses rich:extendedDataTable. If sortby is clicked in the page where table is used and if I navigate to another page, it looks for the bean of the old page and throws an error saying that sortyBy of the column is undefined.

       

      For eg if iused sortBy on userId in tab1( where the table column must have had sortBy=#{data.userId}) and then i click on tab2 , it looks for the data.userId and thorws an error. I am using richfaces 3.2.2SR1 version.

       

      can you help me on this.

       

      complete trace javax.el.PropertyNotFoundException: /com/historyDetails.xhtml @33,174 sortBy="#{data.statusChangeTime}": Property 'statusChangeTime' not found on type uk.ApplicationAttributeEntity com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:73) org.richfaces.model.impl.expressive.ValueBindingExpression.evaluate(ValueBindingExpression.java:59) org.richfaces.model.impl.expressive.ObjectWrapperFactory.wrapObject(ObjectWrapperFactory.java:189) org.richfaces.model.ModifiableModel$RowKeyWrapperFactory.wrapObject(ModifiableModel.java:57) org.richfaces.model.impl.expressive.ObjectWrapperFactory$2.convert(ObjectWrapperFactory.java:177) org.richfaces.model.impl.expressive.ObjectWrapperFactory.convertList(ObjectWrapperFactory.java:138) org.richfaces.model.impl.expressive.ObjectWrapperFactory.wrapList(ObjectWrapperFactory.java:175) org.richfaces.model.ModifiableModel.sort(ModifiableModel.java:235) org.richfaces.model.ModifiableModel.modify(ModifiableModel.java:206) org.richfaces.component.UIExtendedDataTable.createDataModel(UIExtendedDataTable.java:310) org.ajax4jsf.component.UIDataAdaptor.getExtendedDataModel(UIDataAdaptor.java:621) org.ajax4jsf.component.UIDataAdaptor.setRowKey(UIDataAdaptor.java:339) org.ajax4jsf.component.UIDataAdaptor.iterate(UIDataAdaptor.java:1034) org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1158) org.ajax4jsf.component.UIDataAdaptor.processDecodes(UIDataAdaptor.java:1168) javax.faces.component.UIForm.processDecodes(UIForm.java:209) org.ajax4jsf.component.AjaxViewRoot$1.invokeContextCallback(AjaxViewRoot.java:392) org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:238) org.ajax4jsf.component.AjaxViewRoot.processDecodes(AjaxViewRoot.java:409) com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341) org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177) org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267) org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380) org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

       

      I tried using scrollabledatatable and used sorting still the same issue.

        • 1. Re: After rich:extendedDataTable sortby,otheractions are not getting executed

          I have resolved this now.I had to implement the the extendeddatatable and overwrite

          getValueExpression method for the above problem.I am surprised no one encountered this problem while using rich faces.

          • 2. Re: After rich:extendedDataTable sortby,otheractions are not getting executed
            ilya_shaikovsky

            I do not think that that was not answered because nobody had such problem. just too much topics and somtimes we need to be pinged for attention please show your case code. I'm not sure that obverriding component methods is proper solution for the problem..

            • 3. Re: After rich:extendedDataTable sortby,otheractions are not getting executed

              Ilya, The main reson for error we have group of tabs and the all the pages(related to each tab)  depends on a one single object which is in session and intialized at the start.each page has its own defined from this object. Now as mentioned when in the page where extendeddatatable is used, and sortby is used and then we navigate to any other page, it tries to create a dextendeddatatable and tries to look up for the the column used for srting.Obviously the other pages do not have this column defined. As part of the lookup it calls  getValueExpression(String name) method of Extendeddatatable.

               

              As I have extended the extendeddatatable, i have overriddent he method as follows.

               

               

               

               

               

               

               

               

               

               

               

               

               

               

               

              public

               

               

              ValueExpression getValueExpression(String name) {

              ValueExpression valueExpression =

               

              super

              .getValueExpression(name);

               

               

              if (valueExpression != null && valueExpression.getExpressionString() != null && valueExpression.getExpressionString().equals("#{histList}"

              )) {

              String tab = (String)

               

              this.getFacesContext().getExternalContext().getSessionMap().get("currentTab"

              );

               

               

              if (tab==null || (tab != null && !tab.equals("com.cgey.uk.capm.client.amendapplication.HistoryPanel"

              ))) {

               

               

              return null

              ;

              }

              }

               

               

              return

              valueExpression;

              }

               

              brief explanation of the code above, histList is the list called in the history page for listing the items of extendeddatatable and "com.cgey.uk.capm.client.amendapplication.HistoryPanel" is the tab page.

               

              this method is called in all tabs even though extendeddatatable is not used in all tabs.

               

              If i didnt override this method , the value expression used to return some value which is specific to history page only and used to fall over with error i posted earlier . So i have deliberately checked if it is not history tab ,then return null.

               

              Please advice me if i can go for a better solution.

              • 4. Re: After rich:extendedDataTable sortby,otheractions are not getting executed
                nbelaevski

                Hi Krishna,

                 

                I guess better solution will be to use unique variable names for each view.