11 Replies Latest reply on Jan 16, 2009 7:54 AM by Maciej Szulik

    rich:column + h:selectBooleanCheckbox rendered problem

    Maciej Szulik Newbie

      Hi there all,
      I having quite bizarre issue, first sample code:

      <rich:dataTable value="#{things}" var="x">
       <rich:columnGroup rendered="#{x.class.simpleName == 'Thing1'}">
       ....
       <rich:column>
       <h:selectBooleanCheckbox value="#{x.fieldFromThing1Only}" />
       </rich:column>
       ....
       </rich:columnGroup>
      </rich:dataTable>
      


      In the above code I'm iterating through list of things, but certain columns should appear only for let's say Thing1, that's why there's rendered attribute in the columnGroup above. But somehow, I don't know why this selectBooleanCheckbox is rendered, if the condition is false. I even tried to put false in the rendered attribute explicitly - didn't help. Also putting rendered attribute to the selectBooleanCheckbox - not a change, even if there false explicitly.
      I already posted similar problem to the Seam forum: http://www.seamframework.org/Community/Seam211GARichFaces330CR2RenderedProblem, but didn't receive any help.

      Appreciate any help,
      Maciej



        • 1. Re: rich:column + h:selectBooleanCheckbox rendered problem
          Maciej Szulik Newbie

          I almost forget to mention, I upgraded to Seam to 2.1.1 GA and RF to 3.3.0.CR3 and it started happening from that time. Previously I was using
          Seam 2.0.2 SP1 and RF 3.1.6 GA and everything worked just fine.

          • 2. Re: rich:column + h:selectBooleanCheckbox rendered problem
            Ilya Shaikovsky Master

            1) I've defined

            <rich:columnGroup rendered="false">

            2) also defined
            <rich:column colspan="5" rendered="false">


            in demosite sample. columnGroup and corresponding column disappears after page refresh. So seems need more details. Maybe you able to provide the working sample?

            And by the way the questions is different at seam forum and there.



            • 3. Re: rich:column + h:selectBooleanCheckbox rendered problem
              Ilya Shaikovsky Master

              b.t.w. also could you get 3.3.0 GA?

              • 4. Re: rich:column + h:selectBooleanCheckbox rendered problem
                Maciej Szulik Newbie

                I've tried 3.3.0 GA and it didn't help. But now I can specify more precisely the problem, I think ;)

                The problem occurs when that table is rerendered after ajax submit. E.g. I have a tree, based on selected item from that tree I render that table and then it gives this error. I also noticed that when rerendering tree it tries to render those treeNodes which type doesn't match.

                Unfortunately I can't reproduce that on brand new Seam 2.1.1 and RF 3.3.0 project :(

                Could it be, that when upgrading my project libs I missed something?

                Thanks,
                Maciej

                • 5. Re: rich:column + h:selectBooleanCheckbox rendered problem
                  Maciej Szulik Newbie

                  One more thing, when I turned off ajaxSubmitSelection flag (false), I don't get this error, but then nothing happens - which is obvious when I turned ajax off.

                  • 6. Re: rich:column + h:selectBooleanCheckbox rendered problem
                    Ilya Shaikovsky Master

                    could you please check a4j:log output? maybe some errors there?

                    • 7. Re: rich:column + h:selectBooleanCheckbox rendered problem
                      Maciej Szulik Newbie

                       

                      "ilya_shaikovsky" wrote:

                      And by the way the questions is different at seam forum and there.


                      Well, I won't be so sure that this is different, the thing I described there, is that when parent (rich:column) has it's rendered flag = false then children are rendered, why? Previously it worked just fine, which means children didn't get rendered when parent rendered was false.
                      Am I missing something?

                      Maciej

                      • 8. Re: rich:column + h:selectBooleanCheckbox rendered problem
                        Maciej Szulik Newbie

                        The only error I can find is that it can't convert typeA to typeB (below).
                        But this is because in certain rich:treeNode which doesn't supposed to be rendered (attribute type is different) it's trying to pass different parameter.

                        12:45:26,640 WARN [lifecycle] executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@b022d3) threw exception
                        java.lang.IllegalArgumentException: Cannot convert of type class org.test.model.Thing1 to class org.test.model.Thing2
                         at org.jboss.el.lang.ELSupport.coerceToType(ELSupport.java:358)
                         at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:322)
                         at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:274)
                         at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
                         at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
                         at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
                         at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
                         at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:370)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:75)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
                         at org.richfaces.renderkit.TreeRendererBase.encodeAjaxChildren(TreeRendererBase.java:389)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
                         at org.richfaces.renderkit.TreeRendererBase.encodeAjaxChildren(TreeRendererBase.java:389)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
                         at org.richfaces.renderkit.TreeRendererBase.encodeAjaxChildren(TreeRendererBase.java:389)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
                         at org.richfaces.renderkit.TreeRendererBase.encodeAjaxChildren(TreeRendererBase.java:389)
                         at org.ajax4jsf.component.UIDataAdaptor.encodeAjaxChild(UIDataAdaptor.java:454)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:104)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
                         at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
                         at org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:123)
                         at org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:677)
                         at org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:548)
                         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
                         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
                         at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
                         at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
                         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
                         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                         at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                         at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                         at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                         at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                         at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         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:230)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                         at java.lang.Thread.run(Thread.java:619)
                        


                        • 9. Re: rich:column + h:selectBooleanCheckbox rendered problem
                          Maciej Szulik Newbie

                          And the other one is what I started this thread from, which is missing property:

                          12:45:26,359 WARN [lifecycle] phase(UPDATE_MODEL_VALUES 4,com.sun.faces.context.FacesContextImpl@b022d3) threw exception: javax.faces.FacesException: javax.el.PropertyNotFoundException: /member/thingsForm.xhtml @303,76 value="#{x.property2}": Property 'property2' not found on type javax.faces.model.SelectItem javax.el.PropertyNotFoundException: /member/thingsForm.xhtml @303,76 value="#{x.property2}": Property 'property2' not found on type javax.faces.model.SelectItem
                          javax.faces.component.UIOutput.getValue(UIOutput.java:176)
                          com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
                          com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                          javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                          org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
                          org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                          org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                          org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                          org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                          org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                          org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                          org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                          org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                          org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                          org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                          org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                          org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                          org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                          org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                          org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                          org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                          org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                          org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                          org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                          org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                          java.lang.Thread.run(Thread.java:619)
                          


                          • 10. Re: rich:column + h:selectBooleanCheckbox rendered problem
                            Maciej Szulik Newbie

                            The simplest solution to the first one is that I can accept Object parameter and then check for what I need, but not just the way it should happen.
                            But I don't know how to get rid of the other one, which is somehow connected to the problem I described at seam forum.

                            Maciej

                            • 11. Re: rich:column + h:selectBooleanCheckbox rendered problem
                              Maciej Szulik Newbie

                               

                              "soltys" wrote:

                              12:45:26,640 WARN [lifecycle] executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@b022d3) threw exception
                              java.lang.IllegalArgumentException: Cannot convert of type class org.test.model.Thing1 to class org.test.model.Thing2
                              ...
                              


                              I think I found solution for this problem, I completely forgot that my partners wrote a piece of phase listener which removes trailing spaces from all input fields, and this is where the warning comes from. I found that they iterate through all the children which obviously causes the problem.

                              Yet still the other one open :(

                              Maciej,