2 Replies Latest reply on Feb 25, 2013 10:09 AM by John Scott

    a4j:commandLink not work at first time

    John Scott Newbie

      I have a rich:toolbar that contain a a4j:commandLink but this commandLink work only at second click .

       

        

       <ui:define name="topArea">
            <rich:toolbar height="25" >
                <a4j:commandLink  action="#{myBean.action}" status="S1" execute="@form">
                  <h:graphicImage value="/resources/img/salva.png"/>
              </a4j:commandLink>                    
            </rich:toolbar>        
          </ui:define>
      

       

       

      why is this happening?

        • 1. Re: a4j:commandLink not work at first time
          Manuel Fehlhammer Newbie

          Hi Scott,

           

          Where are your <h:form> in your example? Are you sure that you are NOT re-rendering the h:form which contains your a4j:commandLink from another h:form?

          In case you do such things, the first action in the rerendered form will fail.

           

          See for instance here or here.

           

          Bye,

          Manuel

          1 of 1 people found this helpful
          • 2. Re: a4j:commandLink not work at first time
            John Scott Newbie

            i have a dynamic rich:tabPanel where i add and remove tabs dynamically,

            within of this tabs i have many rich:faces components that not works at first click

             

            this is my rich:tabPanel

             

            <rich:tabPanel id="tabsPanel" switchType="client"  activeItem="#{tabsBean.activeTab}" >

                <c:forEach var="tab" items="#{tabsBean.tabs}" >

                     <rich:tab name="#{tab.name}" onheaderclick="switchTab('#{tab.name}');" >

                         <f:facet name="header">

                              <h:panelGrid columns="2">

                                <h:outputText value="#{tab.name}" />

                                <h:graphicImage value="#{pathImmagini.pathImmagineElimina}"

                                                style="width:12px; height:12px;"

                                                onclick="myFunc('#{tab.name}'); Event.stop(event);"/>

                            </h:panelGrid>

                        </f:facet>

                         <h:form id="#{tab.name}" >

                            <ui:include src="#{tab.pathDaIncludere}" />

                        </h:form>

                    </rich:tab>

                 </c:forEach>    

            </rich:tabPanel>