1 Reply Latest reply on Mar 22, 2007 7:47 AM by Ilya Shaikovsky

    include rerender action problem

    Andreas Franke Apprentice

      HI,

      have some problems to understand using include and rerender the right way.

      Have a page containing a navigation with command elements and a <a4j:include> insert other pages.

      <h:panelGroup id="center">
       <a4j:outputPanel>
       <a4j:include viewId="/foo.xhtml" />
       </a4j:outputPanel>
      </h:panelGroup>
      



      For i.e. such other page named foo.xhtml. This page contains a commandButton to direct to an other page named usereditor
      <a4j:commandButton action="usereditor" value="Next >>" reRender="center"/>
      


      This work perfectly - only the element with id "center" is rerendered and usereditor site is included in page.

      But call the same commandButton from the navigation outside the "center" element cause that the usereditor page is displayed alone.

      navigation.xml
      <navigation-rule>
       <from-view-id>*</from-view-id>
       <navigation-case>
       <from-outcome>usereditor</from-outcome>
       <to-view-id>/usereditor.xhtml</to-view-id>
       </navigation-case>
      </navigation-rule>
      


      What can I do to solve this problem. Have already tried some experiments(put a region with renderRegionOnly="fasle" to navigation for example) and some wrong trials (http://jboss.com/index.html?module=bb&op=viewtopic&t=104488)


      Hope for reply

      here the complete main page
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
       xmlns:rich="http://richfaces.ajax4jsf.org/rich"
       xmlns:t="http://myfaces.apache.org/tomahawk">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title>sonderfreigabe</title>
      <link href="./stylesheet/theme.css" rel="stylesheet" type="text/css" />
      </head>
      
      <body>
       <div id="bodycontent">
       <div id="north">
       </div>
      
       <div id="west">
       <h:form>
      
      
       <rich:panelBar height="300" id="panelbar" width="160">
       <rich:panelBarItem binding="#{pagecontent.myBarItem}" id="sf" label="SF">
       <a4j:commandButton action="usereditor" value="Next >>" reRender="center"/>
       </rich:panelBarItem>
       </rich:panelBar>
       </h:form>
       </div>
      
       <a4j:region renderRegionOnly="false">
       <h:panelGroup id="center">
       <a4j:outputPanel>
       <a4j:include viewId="/foo.xhtml" />
       </a4j:outputPanel>
       </h:panelGroup>
       </a4j:region>
       </div>
      </body>
      </html>
      


      and usereditor.xhtml
      <a4j:form xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
       xmlns:rich="http://richfaces.ajax4jsf.org/rich"
       xmlns:t="http://myfaces.apache.org/tomahawk">
      
       <br/>
      
       <s:validateAll>
       <f:facet name="aroundInvalidField">
       <s:span styleClass="errors"/>
       </f:facet>
       <div id="undiv" class="entry">
       <div class="label"><h:outputLabel for="username">Username:</h:outputLabel></div>
       <div class="input">
       <s:decorate>
       <h:inputText id="username" value="#{user.username}" required="true" partialSubmit="true" >
       </h:inputText>
       <br/>
       <s:message/>
       </s:decorate>
       </div>
       </div>
       </s:validateAll>
      
      </a4j:form>
      



      Thanks
      Andi