1 2 Previous Next 16 Replies Latest reply on Jan 5, 2009 1:03 PM by nathan dennis

    scrollableDataTable : issues with selection attribute

    Murali Manohar Newbie

      Hi,
      I am running in to exceptions when i use selection attribute with scrollableDataTable tag.
      Exception :

      org.apache.jasper.el.JspELException: /SdPlaylistStatus.jsp(308,8) '#{sdPlaylistStatusManaged.selection2}' java.lang.IllegalArgumentException: argument type mismatch
      org.apache.jasper.el.JspValueExpression.setValue(JspValueExpression.java:94)
      org.richfaces.renderkit.html.SelectionRendererContributor.decode(SelectionRendererContributor.java:123)
      org.richfaces.renderkit.CompositeRenderer$1.execute(CompositeRenderer.java:77)


      Note: I used both
      org.richfaces.model.selection.SimpleSelection;
      org.richfaces.model.selection.Selection; in my backing bean.


      Here is my jsp code.

      <rich:scrollableDataTable id="sampleData1" rowKeyVar="rkv"
       value="#{sdPlaylistStatusManaged.logMsgList}" var="row1"
       rows="3" selection="#{sdPlaylistStatusManaged.selection1}">
       <a4j:support event="onRowClick" action="#{sdPlaylistStatusManaged.takeSelection}"/>
      


      and backing bean code.

      import org.richfaces.model.selection.SimpleSelection;
      import org.richfaces.model.selection.Selection;
      
      public SimpleSelection getSelection1() {
       return selection1;
       }
       public void setSelection1(SimpleSelection selection1) {
       this.selection1 = selection1;
       }
      
      public String takeSelection() {
       System.out.println("takeSelection");
       Iterator iterator =getSelection1().getKeys();
       while (iterator.hasNext()){
       SimpleRowKey key = (SimpleRowKey)iterator.next();
       System.out.println(key.intValue());
       }
       return null;
       }




        • 1. Re: scrollableDataTable : issues with selection attribute
          Murali Manohar Newbie

          I got above exception when i use Selection as component class for my selection1.

          ie some thing like this in my backing bean.

          private Selection selection1;




          I got below exception when i use SimpleSelection as componenet class for selecttion1.

          ie some thing like this in my backing bean.
          private SimpleSelection selection1 = new SimpleSelection();


          I got below exception when use SimpleSelection as componenet class for selecttion1.

          javax.servlet.ServletException: Cannot convert org.richfaces.model.selection.SimpleSelection@896 of type class org.richfaces.model.selection.SimpleSelection to interface org.richfaces.model.selection.Selection
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
          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.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:50)
          org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)
          org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
          org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:99)
          org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

          root cause

          java.lang.IllegalArgumentException: Cannot convert org.richfaces.model.selection.SimpleSelection@896 of type class org.richfaces.model.selection.SimpleSelection to interface org.richfaces.model.selection.Selection
          org.apache.el.lang.ELSupport.coerceToType(ELSupport.java:374)
          org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:188)
          org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
          org.richfaces.component.html.HtmlScrollableDataTable.getSelection(HtmlScrollableDataTable.java:896)
          org.richfaces.renderkit.html.SelectionRendererContributor.encodeSelection(SelectionRendererContributor.java:214)
          org.richfaces.renderkit.html.SelectionRendererContributor.encode(SelectionRendererContributor.java:191)
          org.richfaces.renderkit.html.ScrollableDataTableBaseRenderer.contributorsEncodeHere(ScrollableDataTableBaseRenderer.java:929)
          org.richfaces.renderkit.html.ScrollableDataTableRenderer.doEncodeEnd(ScrollableDataTableRenderer.java:562)
          org.richfaces.renderkit.html.ScrollableDataTableRenderer.doEncodeEnd(ScrollableDataTableRenderer.java:606)
          org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:135)
          org.richfaces.renderkit.html.ScrollableDataTableBaseRenderer.encodeEnd(ScrollableDataTableBaseRenderer.java:857)
          javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
          org.richfaces.component.UIScrollableDataTable.encodeEnd(UIScrollableDataTable.java:353)
          org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
          org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
          org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:220)
          org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:215)
          org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
          javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
          org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
          org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
          org.richfaces.renderkit.html.ModalPanelRenderer.doEncodeChildren(ModalPanelRenderer.java:385)
          org.richfaces.renderkit.html.ModalPanelRenderer.doEncodeChildren(ModalPanelRenderer.java:380)
          org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
          javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
          javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
          javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
          javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
          com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:245)
          com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:176)
          org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
          org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
          com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
          com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
          com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
          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.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:50)
          org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)
          org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
          org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:99)
          org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


          • 2. Re: scrollableDataTable : issues with selection attribute
            nathan dennis Expert

            i suspect that this error has the same source as the one im experience... outlined in the thread below this.

            • 3. Re: scrollableDataTable : issues with selection attribute
              nathan dennis Expert

              have you figured this out yet?? its still nagging me aswell.

              • 4. Re: scrollableDataTable : issues with selection attribute
                nathan dennis Expert

                this smells of bug... it works with older versions. perhaps we should file a ticket in jira

                • 5. Re: scrollableDataTable : issues with selection attribute
                  nathan dennis Expert

                  nope that isnt it either... bad test...
                  could someone that knows please comment on this..

                  • 7. Re: scrollableDataTable : issues with selection attribute
                    Nick Belaevski Master

                    Hello,

                    Looks like a classloader issues. I've just checked richfaces-demo, works fine with the latest 3.3.0-snapshot. So can you please provide some more information:

                    1. RF version
                    2. Seam version (if any)
                    3. Application server version
                    4. Project layout (EAR/WAR)?

                    • 8. Re: scrollableDataTable : issues with selection attribute
                      nathan dennis Expert

                      for some reason it didnt send a email on reply ... thanks for the responses and patience.

                      richfaces snap 3.3.0 12/26/08
                      seam 2.1.0.sp1
                      jboss.4.2.2.ga
                      EAR

                      i have richfaces api impl & ui in ear/lib and ear/war/web-inf/lib

                      • 9. Re: scrollableDataTable : issues with selection attribute
                        nathan dennis Expert

                        i looked at the working example. it is almost the same as the demo example in the trunk.

                        i suspect after all this is sorted out we will find that it is an issue integrating richfaces with seam. according to the seam doc,, UIComponents must be stored in a bean of EVENT scope. that bean can then be injected into the conversation scope. this is the approach i took with no success.

                        • 12. Re: scrollableDataTable : issues with selection attribute
                          Nick Belaevski Master

                           

                          "nathandennis" wrote:
                          i have richfaces api impl & ui in ear/lib and ear/war/web-inf/lib


                          Looks like that's the thing causing problems. Class with the same name is being loaded from two different locations leading to CCE. Does it work if you leave api .jar in ear/lib and impl, ui .jar files in war/WEB-INF/lib? Please try.

                          • 13. Re: scrollableDataTable : issues with selection attribute
                            Tuncay Tunc Newbie

                            Hi,
                            I have the same problem like mchepuri.
                            I tried it with:
                            - AS 4.2.2.GA
                            - Seam: 2.1.0.GA / 2.1.1.GA
                            - RichFaces: 3.2.0.SR1 / 3.2.2.GA / 3.2.2.SR1 / SNAPSHOT(20090104.050652-112)

                            but no success.

                            Can anyone help me to get the row selection in scrollableDataTable?
                            My Code is like that in RichFaces FAQ (http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/docs/devguide/en/faq/faq.html) and I got the same errors like mchepuri.

                            Thanks.

                            • 14. Re: scrollableDataTable : issues with selection attribute
                              Ilya Shaikovsky Master

                              tuncty, have you read previous comment, especially:


                              Does it work if you leave api .jar in ear/lib and impl, ui .jar files in war/WEB-INF/lib? Please try.


                              1 2 Previous Next