5 Replies Latest reply on Sep 2, 2009 4:42 AM by ka1zer

    Rerender after ajax when facelets template is reloaded doesn

      Hi.

      I apoligize if this has already been asked, but I didn't find anything, so here goes. :o)

      Not really sure if this is a problem with richfaces (a4j), facelets or jsf...

      I'm using Richfaces 3.3.1.GA, facelets from latest jboss-tools stable (facelets version 1.1.15.B1?) on jboss 4.3.2.GA.

      I have one page with a simple a:commandButton that calls a method on my bean.
      On the same page I have a ui:include where I include another page.

      In the other page I have an a:outputPanel with ajaxRendered=true, and javascript with an alert inside the outputpanel.

      The results of this is a page with a button. I press the button and get an alert. So far so good.

      But, if I change something in (or just touch) the included page, pressing the button does nothing. I have to refresh the entire page before the button works again. Changing the main page is no problem.

      After sniffing some packets, I see that the xml returned from the ajax-call references different IDs after I have touched the page. These IDs don't exist.

      I guess this is normal, since it has to create the page anew, but the result is that if we make any change in our facelets templates, users will get unexpected results when using ajax-functionality on our pages...

      Is this a known problem? Any workarounds?

      Relevant code from main page:

      <ui:include src="included.xhtml">
      </ui:include>
      
      <h:form>
       <a:commandButton action="#{myBean.test()}" value="Test"/>
      </h:form>
      


      included.xhtml:
      <h:form>
       <a:outputPanel ajaxRendered="true">
       <script type="javascript">
       alert('Test!');
       </script>
       </a:outputPanel>
      </h:form>
      


      (ajaxRendered="false" and reRender on button gives same results.)