4 Replies Latest reply on Jul 10, 2012 10:15 AM by ealonso04

    a4j:commandButton always executes form even when execute id's given

    nandish

       

       

      I have a a4j:commandLink which is supposed to execute a a4j:outputPanel on click.  However it executes the form on click even when I have given the id's in the execute tag

       

      <a4j:commandLink id="more_message_button"

                                                          value
      ="Load More Comments"
                                                          action
      ="#{feedbackAction.setFeedbackIdForExpansion(unitfeedback.feedbackId)}"
                                                          execute
      ="expandedList,more_message_button" href="javascript:void(0)" limitRender="true"
                                                          render
      ="expandedList,more_message_button">
                                                     
      </a4j:commandLink>`


                                                 
      <a4j:outputPanel layout="block" id="expandedList">



      <a4j:repeat
                                                          value
      ="#{feedbackAction.getCommentsForNextHop(unitfeedback)}"
                                                          var
      ="unitComment" rowKeyVar="idx">
        
      .
        
      .
        
      .

      </a4j:outputPanel>

       

       

      Any help on this to overide the default behavior or am I missing anything here

      Regards,

      Nandish

      .

        • 1. Re: a4j:commandButton always executes form even when execute id's given
          ealonso04

          Hi Nandish!

           

          What about getting out the panel id from the execute and just leaving it in the render? Or you can use the execute="@this".

          And getting out the commandLink id from the render?

           

          Like this:

          <a4j:commandLink id="more_message_button"

                                                              value
          ="Load More Comments"
                                                              action
          ="#{feedbackAction.setFeedbackIdForExpansion(unitfeedback.feedbackId)}"
                                                              execute
          ="@this" href="javascript:void(0)" limitRender="true"
                                                              render
          ="expandedList">
                                                         
          </a4j:commandLink>`


                                                     
          <a4j:outputPanel layout="block" id="expandedList">

           

          Regards!

          1 of 1 people found this helpful
          • 2. Re: a4j:commandButton always executes form even when execute id's given
            nandish

            No luck. I tried with execute="@this" and execute ="@none", the behavior does not change at all

            • 3. Re: a4j:commandButton always executes form even when execute id's given
              nandish

              Found out the issue, The issue was unitfeedback object which was basically coming from outer a4j:repeat. When we ask the jsf to reremder or only execute thie piece, it will not know waht is unitfeedback object. Instead calls the form to be executed and finds out what us unitfeedback.

              • 4. Re: a4j:commandButton always executes form even when execute id's given
                ealonso04

                Im glad you found the solution!

                 

                Regards!