7 Replies Latest reply on Mar 30, 2009 5:52 AM by Ilya Shaikovsky

    action of ajax rendered action component does not get called

    Ben Utzer Newbie

      Hi,

      I have what seems like a trivial problem (see code below).
      The test.notInvoked action does not get invoked after the component gets rendered via ajax. It only works when I set the ajaxRendered attribute of the gotoPrevious outputpanel to true.test is a seam component in conversation scope.

      Any help how to get this working would be much appreciated.

      Thanks,
      Ben

      Page:

      <!DOCTYPE composition 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:h="http://java.sun.com/jsf/html"
       xmlns:a="http://richfaces.org/a4j">
      <head>
      <title>Test</title>
      </head>
      <body>
      <h:form>
       <a:outputPanel id="gotoPrevious">
       <a:commandLink value="Previous Page" action="#{test.notInvoked}"
       rendered="#{test.shouldRender}" reRender="gotoPrevious">
       </a:commandLink>
       </a:outputPanel>
       <a:outputPanel id="gotoNext">
       <a:commandLink value="Next Page" action="#{test.render}"
       reRender="gotoPrevious">
       </a:commandLink>
       </a:outputPanel>
      </h:form>
      </body>
      </html>
      


      Bean:
      public class Test {
      
       private boolean shouldRender;
      
       public void notInvoked() {
       System.out.println("works");
       }
      
       public boolean isShouldRender() {
       return this.shouldRender;
       }
      
       public void setShouldRender(boolean shouldRender) {
       this.shouldRender = shouldRender;
       }
      
       public void render() {
       this.shouldRender = true;
       }
      }