2 Replies Latest reply on May 11, 2010 9:35 AM by devika.nrgh

    h:commandLink now working with a4j:include

    wellingtonsampaio

      Hi all,


      I am facing a problem using a a4j:include. I made a master form (xhtml) with 2 tabs, each one including another xhtml with a h:dataTable.


      I also have a h:commandLink as a column in the h:dataTable. The problem is that when the user selects the link, the method in the managed bean is called but the redirection to the next page does not work.
      Below are the source codes. Additionaly, the method on the managed bean return the string edit.


      <rich:panel>
          <rich:tab>
              <a4j:include id="includeByGroup" ajaxRendered="true" viewId="TableByGroup.xhtml">
              </a4j:include>
          </rich:tab>
          <rich:tab>
             <a4j:include id="includeByMenu" ajaxRendered="true" viewId="TableByMenu.xhtml">
             </a4j:include>
         </rich:tab>
      </rich:panel>
      



      <rich:column id="colAction" sortable="false">
          <h:commandLink action="#{myMB.select(group)}">
              <h:graphicImage url="/img/edit.png"></h:graphicImage>
          </h:commandLink>
      



      <page view-id="/pages/masterGroup.xhtml">
          <navigation>
           <rule if-outcome="edit">
               <redirect view-id="/pages/nextPage.xhtml"></redirect>
           </rule>
          </navigation>
      </page>
      

        • 1. Re: h:commandLink now working with a4j:include
          wellingtonsampaio

          Wellington Martins wrote on Nov 24, 2009 14:01:


          Hi all,

          I am facing a problem using a a4j:include. I made a master form (xhtml) with 2 tabs, each one including a xhtml with h:dataTable.

          I also have a h:commandLink as a column in the h:dataTable. The problem is that when the user selects the link, the method in the managed bean is called but does not redirect to the next page.
          Below are the source codes. Additionaly, the method on the managed bean returns the string edit.

          <rich:panel>
              <rich:tab>
                  <a4j:include id="includeByGroup" ajaxRendered="true" viewId="TableByGroup.xhtml">
                  </a4j:include>
              </rich:tab>
              <rich:tab>
                 <a4j:include id="includeByMenu" ajaxRendered="true" viewId="TableByMenu.xhtml">
                 </a4j:include>
             </rich:tab>
          </rich:panel>
          



          <rich:column id="colAction" sortable="false">
              <h:commandLink action="#{myMB.select(group)}">
                  <h:graphicImage url="/img/edit.png"></h:graphicImage>
              </h:commandLink>
          



          <page view-id="/pages/masterGroup.xhtml">
              <navigation>
               <rule if-outcome="edit">
                   <redirect view-id="/pages/nextPage.xhtml"></redirect>
               </rule>
              </navigation>
          </page>
          




          Click HELP for text formatting instructions. Then edit this text and check the preview.

          • 2. Re: h:commandLink now working with a4j:include
            devika.nrgh

            hi,
            write h:commandLink within the form tag.