6 Replies Latest reply on May 7, 2009 10:44 AM by ilya_shaikovsky

    SimpleTogglePanel strange open/close behavior with a4j:repea

    pulkk

      I noticed a strange behavior when doing something like:
      <a4j:repeat>
      <rich:simpleTogglePanel>
      ...
      </rich:simpletogglePanel>
      </a4j:repeat>
      If this loops for, say 3 times, then for some reason the behavior of opening and closing the panels gets messed up:
      - server: when changing the status of one panel, all of the rest changes as well to the same status.
      - ajax and client: change works fine until the next reRender event, then it follows the same behavior: they all open together or close together.

      this can't be normal. Is there something wrong?

        • 1. Re: SimpleTogglePanel strange open/close behavior with a4j:r
          nbelaevski

          Hello,

          Please see workaround described in the JIRA issue

          • 2. Re: SimpleTogglePanel strange open/close behavior with a4j:r
            nbelaevski

            Sorry, workaround won't do its job :( That's really a component bug

            • 3. Re: SimpleTogglePanel strange open/close behavior with a4j:r
              mafym

              Any updates on this issue?

              Here it is mentioned that the bug's status is closed, but the component does not work:

              https://cloud.prod.atl2.jboss.com:8443/jira/browse/RF-3552;jsessionid=7F6AF5FE51032830C499F200A93004A7?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

              This code does not work:

              <ui:composition xmlns="http://www.w3.org/1999/xhtml"
               xmlns:s="http://jboss.com/products/seam/taglib"
               xmlns:ui="http://java.sun.com/jsf/facelets"
               xmlns:f="http://java.sun.com/jsf/core"
               xmlns:h="http://java.sun.com/jsf/html"
               xmlns:a4j="http://richfaces.org/a4j"
               xmlns:rich="http://richfaces.org/rich">
              
               <h:form>
               <a4j:repeat value="#{activityList.resultList}" var="activity">
               <rich:simpleTogglePanel switchType="ajax"
               label="#{activity.name}" >
              
               <h:outputText value="#{activity.description}" />
              
               <h:commandButton action="#{reportGenerator.generate}"
               value="Download Reports" />
              
               </rich:simpleTogglePanel>
               </a4j:repeat>
               </h:form>
              </ui:composition>


              Do you have a clean workable sample or with some workarounds?

              Thank you!

              • 4. Re: SimpleTogglePanel strange open/close behavior with a4j:r
                nbelaevski

                Hello,

                You should add something like

                <rich:simpleTogglePanel switchType="ajax"
                 label="#{activity.name}" opened="#{activity.opened}">
                for this to work.

                • 5. Re: SimpleTogglePanel strange open/close behavior with a4j:r
                  mafym

                  I have added an "opened" property to activity. But I get the following error:

                  17:30:07,715 ERROR [[/testSimpleTogglePanel]] /testSimpleTooglePanel.xhtml @14,82 opened="#{activity.remarkrequired}": java.lang.IllegalArgumentException
                  java.lang.IllegalArgumentException
                   at sun.reflect.GeneratedMethodAccessor414.invoke(Unknown Source)
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                   at java.lang.reflect.Method.invoke(Unknown Source)
                   at javax.el.BeanELResolver.setValue(BeanELResolver.java:108)
                   at javax.el.CompositeELResolver.setValue(CompositeELResolver.java:69)
                   at com.sun.faces.el.FacesCompositeELResolver.setValue(FacesCompositeELResolver.java:100)
                   at org.jboss.el.parser.AstPropertySuffix.setValue(AstPropertySuffix.java:73)
                   at org.jboss.el.parser.AstValue.setValue(AstValue.java:84)
                   at org.jboss.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
                   at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:93)
                   at org.richfaces.component.UISimpleTogglePanel.updateModel(UISimpleTogglePanel.java:292)
                   at org.richfaces.component.UISimpleTogglePanel.broadcast(UISimpleTogglePanel.java:207)
                   at org.ajax4jsf.component.UIDataAdaptor.broadcast(UIDataAdaptor.java:1364)
                   at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
                   at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
                   at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
                   at org.ajax4jsf.component.AjaxViewRoot.processUpdates(AjaxViewRoot.java:432)
                   at com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:78)
                   at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                   at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
                   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.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                   at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                   at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
                   at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
                   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:235)
                   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                   at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                   at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                   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:158)
                   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
                   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                   at java.lang.Thread.run(Unknown Source)
                  17:30:07,747 INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
                  sourceId=j_id0:j_id1:0:j_id2[severity=(ERROR 2), summary=(/testSimpleTooglePanel.xhtml @14,82 opened="#{activity.remarkrequired}": java.lang.IllegalArgumentException), detail=(/testSimpleTooglePanel.xhtml @14,82 opened="#{activity.remarkrequired}": java.lang.IllegalArgumentException)]


                  Thank you in advance!


                  • 6. Re: SimpleTogglePanel strange open/close behavior with a4j:r
                    ilya_shaikovsky

                    and how #{activity.remarkrequired} declared?