2 Replies Latest reply on May 18, 2010 3:31 AM by sergiomartin

    a4j:commandLink not working inside a4j:repeat

    sergiomartin

      Hello everybody.

      I have this piece of code. Everything is rendering fine, but somehow, the links inside the repeat are not arriving to the server.

      What´s weird is that the first part of the code (the one that is not inside the repeat) is working fine. To my eyes, both are the same and, at least, are rendering equally in my browser.

       

      I´m new to richfaces... any clue?

      (The value of the param is hardcoded for testing purposes...)

       

      Thanks a lot!!

       

      CODE:

       

               <a4j:form>

       

                      <div>

                          <a href="#" title="">John Doe</a>

                          <a4j:commandLink reRender="results-view" action="#{actionsContainer.userManagementActions.loadUser}" title="Edit" styleClass="edit">

                              <f:param name="userName" value="john"/>                       

                              <h:outputText value="Edit" /> <small>Edit user<b></b></small>

                              <a4j:support event="onclick">

                                  <f:setPropertyActionListener value="../user-mng/users-edit.xhtml" target="#{layout.displayAs}" />

                              </a4j:support>

                          </a4j:commandLink>               

                      </div>

       

                      <a4j:repeat value = "#{usersBean.users}" var = "user">           

                          <div>

                              <a href="#" title=""><h:outputText value = "#{user.firstname}"/><h:outputText value=" " escape="false" /><h:outputText value = "#{user.lastname}"/></a>

                              <a4j:commandLink reRender="results-view" action="#{actionsContainer.userManagementActions.loadUser}" title="Edit" styleClass="edit">

                                  <f:param name="userName" value="john"/>                            

                                  <h:outputText value="Edit" /> <small>Edit user<b></b></small>

                                  <a4j:support event="onclick">

                                      <f:setPropertyActionListener value="../user-mng/users-edit.xhtml" target="#{layout.displayAs}" />

                                  </a4j:support>

                              </a4j:commandLink>

                          </div>

                      </a4j:repeat>

       

                  </a4j:form>

        • 1. Re: a4j:commandLink not working inside a4j:repeat
          ilya_shaikovsky

          Even if it looks as working for you in one case - it contains wrong usage. And you need to correct and then see if there are any problems remained:

           

          • a4j:support defined at a4j:commandLink - this should not be used like that. command link already ajax action control. And if you adding support - concurrent requests will appear - one from link and one from support.

           

          P.S. moving thread to RichFaces space from RichFaces development,.

          1 of 1 people found this helpful
          • 2. Re: a4j:commandLink not working inside a4j:repeat
            sergiomartin

            Hi Ylia.

             

            Thanks a lot for your answer. Could you provide me with an example on how should I use commandLink in this scenario?

             

            Thanks again for your help.