1 Reply Latest reply on Oct 24, 2008 8:22 AM by Vladimir Kovalyuk

    a4j:include dynamic viewId

    Cezary Olborski Newbie

      Hi!


      This what I need is viewId dynamicly set in a4j:include tag.


      I was trying many different ways but, it still doesn't work.


      This is my  bean code:


      @Name("panelMenu")
      @Scope(SESSION)
      public class PanelMenu implements Serializable {
          private String page;
          public String getPage() {
              return page;
          }
      
          public void setPage(String page) {
              this.page = page;
          }
      }


      This is my page code:



      ...
      <a4j:form>
         <a4j:include id="inpage" viewId="#{panelMenu.page}"/>
      </a4j:form>
      ...



      And finally, this is my error:



      javax.el.ELException: /start.xhtml @65,58 viewId="#{panelMenu.page}": Error reading 'page' on type pl.binfo.view.menu.PanelMenu_$$_javassist_0
              at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
              at org.ajax4jsf.component.UIInclude.getViewId(UIInclude.java:96)
              at org.ajax4jsf.taglib.html.facelets.IncludeHandler.applyNextHandler(IncludeHandler.java:70)
              at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
              at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
              at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
              at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
              at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
              at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
              at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
              at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
              at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144)
              at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
              at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
              at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
              at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
              at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
              at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
              at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
              at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
              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.MultipartFilter.doFilter(MultipartFilter.java:85)
              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:177)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
              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)
      ...



      The same bean works normal in many different places at the same page.


      The same error I see when I put some expression to binding parameter.


      Can anybody tell me where is my simple mistake ?



      This is my configuration:


      Richfaces 3.2.2 G.A.
      Seam  2.0.2.SP1