14 Replies Latest reply on Apr 13, 2011 8:31 AM by Vishwanath Bannur

    Dynamic DataScroll

    Vishwanath Bannur Newbie

      Hi,

       

      I have created dynamic dataTable. I have added the datascroll to it. Howvere in run time i am getting following error.

      Please let me know what is wrong in my code as posted below;

       

       

      Error:

      java.lang.IllegalArgumentException: could not find dataTable with id 'dynamicTableID'

      javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: could not find dataTable with id 'dynamicTableID'

       

       

      Code:

       

      if (dataTable == null) {

                                    dataTable = new HtmlDataTable();

                          }

                          dataTable.setRendered(true);

                          dataTable.setBorder("1");

       

       

                          dataTable.setCellpadding(Constants.cCellPadding);

                          dataTable.setCellspacing(Constants.cCellSpacing);

       

       

                          List list = dataTable.getChildren();

                          list.clear();

                          ValueBinding binding = app.createValueBinding(Constants.cTableBindingLiteral);

                          dataTable.setValueBinding(Constants.cTableBindingAlias, binding);

                          dataTable.setVar(Constants.cTableBindingAlias);

       

       

       

       

                          int columnCount = columnHeaderMap.size();

                          Set<String> Headers = columnHeaderMap.keySet();

                          for (String header : Headers)

                      {

                             String columnBinding = Constants.cTableBindingAlias +"."+columnHeaderMap.get(header);

                                   list.add(createColumn(header, columnBinding,"OUTPUTTEXTBOX", true, "", null));

                      }

       

       

       

       

                          dataTable.setValue(getTableData());

                          dataTable.setId("dynamicTableID");

       

       

       

                          /***************Pagination ***************/

       

       

                          HtmlDatascroller datascroller = new HtmlDatascroller();

                          datascroller.clearInitialState();

       

                           datascroller.setFor("dynamicTableID");

                           datascroller.setPage("1");

                           datascroller.setPageIndexVar("1");

                           dataTable.getFacets().put("footer", datascroller);

        • 1. Dynamic DataScroll
          Nick Belaevski Master

          Hi,

           

          Please post complete exception stack trace.

          • 2. Dynamic DataScroll
            Vishwanath Bannur Newbie

            Hi Nick,

             

            Please find complete stacktrcae:

             

            Nick Belaevski wrote:

             

            Hi,

             

            Please post complete exception stack trace.

             

             

            Mar 30, 2011 10:46:34 AM com.sun.faces.application.ActionListenerImpl processAction

            SEVERE: java.lang.IllegalArgumentException: could not find dataTable with id 'dynamicTableID'

            javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: could not find dataTable with id 'dynamicTableID'

                      at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)

                      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

                      at javax.faces.component.UICommand.broadcast(UICommand.java:315)

                      at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329)

                      at org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304)

                      at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261)

                      at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474)

                      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

                      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)

                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

                      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

                      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)

                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

                      at java.lang.Thread.run(Unknown Source)

            Caused by: java.lang.IllegalArgumentException: could not find dataTable with id 'dynamicTableID'

                      at org.richfaces.component.UIDatascroller.getDataTable(UIDatascroller.java:239)

                      at org.richfaces.component.UIDatascroller.getPageCount(UIDatascroller.java:358)

                      at org.richfaces.component.UIDatascroller.getPageForFacet(UIDatascroller.java:285)

                      at org.richfaces.component.UIDatascroller.setPage(UIDatascroller.java:327)

                      at com.sonata.Ebreez.common.jsf.dynamicdatatable.data.DynamicTable.createUI(DynamicTable.java:95)

                      at com.sonata.Ebreez.common.jsf.dynamicdatatable.data.DynamicTable.getFormElements(DynamicTable.java:62)

                      at com.sonata.Ebreez.DynamicTab.callAction(DynamicTab.java:70)

                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                      at java.lang.reflect.Method.invoke(Unknown Source)

                      at org.apache.el.parser.AstValue.invoke(AstValue.java:191)

                      at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

                      at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

                      ... 28 more

            Mar 30, 2011 10:46:34 AM com.sun.faces.lifecycle.InvokeApplicationPhase execute

            WARNING: #{dynamicTab.callAction}: java.lang.IllegalArgumentException: could not find dataTable with id 'dynamicTableID'

            javax.faces.FacesException: #{dynamicTab.callAction}: java.lang.IllegalArgumentException: could not find dataTable with id 'dynamicTableID'

                      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)

                      at javax.faces.component.UICommand.broadcast(UICommand.java:315)

                      at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329)

                      at org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304)

                      at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261)

                      at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474)

                      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

                      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)

                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

                      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

                      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)

                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

                      at java.lang.Thread.run(Unknown Source)

            Caused by: javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: could not find dataTable with id 'dynamicTableID'

                      at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)

                      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

                      ... 27 more

            Caused by: java.lang.IllegalArgumentException: could not find dataTable with id 'dynamicTableID'

                      at org.richfaces.component.UIDatascroller.getDataTable(UIDatascroller.java:239)

                      at org.richfaces.component.UIDatascroller.getPageCount(UIDatascroller.java:358)

                      at org.richfaces.component.UIDatascroller.getPageForFacet(UIDatascroller.java:285)

                      at org.richfaces.component.UIDatascroller.setPage(UIDatascroller.java:327)

                      at com.sonata.Ebreez.common.jsf.dynamicdatatable.data.DynamicTable.createUI(DynamicTable.java:95)

                      at com.sonata.Ebreez.common.jsf.dynamicdatatable.data.DynamicTable.getFormElements(DynamicTable.java:62)

                      at com.sonata.Ebreez.DynamicTab.callAction(DynamicTab.java:70)

                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                      at java.lang.reflect.Method.invoke(Unknown Source)

                      at org.apache.el.parser.AstValue.invoke(AstValue.java:191)

                      at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

                      at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

                      ... 28 more

            Mar 30, 2011 10:46:34 AM org.apache.catalina.core.StandardWrapperValve invoke

            SEVERE: Servlet.service() for servlet Faces Servlet threw exception

            java.lang.IllegalArgumentException: could not find dataTable with id 'dynamicTableID'

                      at org.richfaces.component.UIDatascroller.getDataTable(UIDatascroller.java:239)

                      at org.richfaces.component.UIDatascroller.getPageCount(UIDatascroller.java:358)

                      at org.richfaces.component.UIDatascroller.getPageForFacet(UIDatascroller.java:285)

                      at org.richfaces.component.UIDatascroller.setPage(UIDatascroller.java:327)

                      at com.sonata.Ebreez.common.jsf.dynamicdatatable.data.DynamicTable.createUI(DynamicTable.java:95)

                      at com.sonata.Ebreez.common.jsf.dynamicdatatable.data.DynamicTable.getFormElements(DynamicTable.java:62)

                      at com.sonata.Ebreez.DynamicTab.callAction(DynamicTab.java:70)

                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                      at java.lang.reflect.Method.invoke(Unknown Source)

                      at org.apache.el.parser.AstValue.invoke(AstValue.java:191)

                      at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

                      at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

                      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

                      at javax.faces.component.UICommand.broadcast(UICommand.java:315)

                      at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329)

                      at org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304)

                      at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261)

                      at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474)

                      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

                      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)

                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

                      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

                      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)

                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

                      at java.lang.Thread.run(Unknown Source)

            • 3. Dynamic DataScroll
              Nick Belaevski Master

              You should first add dataScroller to the component tree, then set its 'page' attribute.

              • 4. Re: Dynamic DataScroll
                Vishwanath Bannur Newbie

                Hi Nick,

                 

                Is it rite one?

                 

                 

                if (grid == null) {

                  grid = new HtmlPanelGrid();

                  }

                 

                  HtmlDatascroller datascroller = new HtmlDatascroller();

                  datascroller.clearInitialState();

                 

                  datascroller.setFor("dynamicTableID");

                  datascroller.setPageIndexVar("1");

                 

                  grid.getChildren().add(datascroller);

                 

                  dataTable.getFacets().put("footer", datascroller);

                  grid.getChildren().add(dataTable);

                • 5. Re: Dynamic DataScroll
                  Vishwanath Bannur Newbie

                  Nick,

                   

                  Still I am getting same error

                  • 6. Re: Dynamic DataScroll
                    Vishwanath Bannur Newbie

                    Hi Nick,

                     

                    Now I am getting the pagination by slightmodification in ‘DynamicTable.java’ as I have attached the code. However onclick of next or previous button, the table data is vanishing.

                    May I know what wrong in my code or what I havedid is rite way?

                    I have attached the whole code here. Pleasegive me suggestions.

                     

                    The Testjava.java class is in session scope.

                     

                    • 7. Re: Dynamic DataScroll
                      Vishwanath Bannur Newbie

                      Nick,

                           Any help

                      • 8. Re: Dynamic DataScroll
                        Ilya Shaikovsky Master

                        sorry, Nick are not able to look forum for a few days.. And I really missed that topic because thought  that he solved that. Sorry for the delay I will check today.

                        • 9. Re: Dynamic DataScroll
                          Vishwanath Bannur Newbie

                          Thank you So much

                          • 10. Re: Dynamic DataScroll
                            Ilya Shaikovsky Master

                            sorry for delay.

                             

                            I added only

                            @Name(value="testjava")

                            @Scope(ScopeType.SESSION)

                            because you not provided config and I was not sure how to register.(supposed that session because you not recreating component in getter but just getting the same variable)

                             

                            no more changes was made.

                             

                            And it just works for me.. I stored 7 recods. and when switched using DS - seeing 3 last records fine.

                            • 11. Re: Dynamic DataScroll
                              Vishwanath Bannur Newbie

                              Hi Ilya,

                               

                              It would be great if you can attach your code, so I can compare what wrong in my code and let you know.

                               

                              Thanks & regards,

                              Vishwanath

                              • 12. Re: Dynamic DataScroll
                                Vishwanath Bannur Newbie

                                Hi Ilya,

                                 

                                May I know which version of JSF and Richfaces are you using?

                                 

                                Here I have attached my web.xml and I have configured the facelets. Is the right facelets configuration what I did in web.xml?

                                If any changes please let me know. I will be waiting for you reply.

                                • 13. Re: Dynamic DataScroll
                                  Ilya Shaikovsky Master

                                  two significant differences I see that I checked under 3.3.4 SNAPSHOT and JSF 1.2 (rf-demo environment)

                                  • 14. Re: Dynamic DataScroll
                                    Vishwanath Bannur Newbie

                                    Hi Ilya,

                                     

                                    Can you attach your code?