4 Replies Latest reply: Oct 1, 2013 4:22 AM by Anujit RSS

    actionListener is not responding from af:commandButton in jsff

    Anujit

      Hi,

       

      We have a af:commandButton inside a jsff file and we are firing a actionListener bean method . This method actually brings up a print popup and redirects the page as well in the background.

      But somehow this method is not being reached although the popup is coming up. This is happening even I remove the contents of the method completely. It is good to note that the managed bean is in session scope.

       

      Regards,

      Anujit

        • 1. Re: actionListener is not responding from af:commandButton in jsff
          Hoque

          Hi,

          This is a typical issue.

           

          Try setting PartialSubmit to TRUE for commandButton and see if it then works.



          If this is not working ,then probably you can try  to set triggerType of ShowPopupBehavior to click.


          Because as per the documentation,


          The af:showPopupBehavior tag is a declarative way to show a af:popup in response to a client-side event. The client event is specified using the triggerType attribute. The "action" event is the default triggerType if one is not provided.
          ....

          All actionListener method bindings and associated action listeners will not be invoked when the triggerType of "action" is used.

           

          So the solution is to just set the triggerType of ShowPopupBehavior to click.


          In my view,the first solution is better approach.


          But what I didn't understand is - why you need redirect and pop up sametime or almost subsequently. Is this you design approach.


          However,I hope the solution works for you.


          Regards,

          Hoque

          • 2. Re: actionListener is not responding from af:commandButton in jsff
            Anujit

            Hi,

             

            The partialsubmit doesn't make any difference.

            It is a design need that the redirect to another page as well as the popup comes up at the same time. The key point here is the dialog is being launched from the code in the method itself. The method is not being reached. Most awkward is how the popup is coming up even when the method contents are emptied.

             

            Regards,
            Anujit

            • 3. Re: actionListener is not responding from af:commandButton in jsff
              Hoque

              A) can you test the same scenario while pop up code will be present at jspx or jsff page level instead of  java code level.  And carefully check in jsff code for "set the triggerType of ShowPopupBehavior to click.".

              B) Also try to clean your project and create a new actionlistener method and test it again.

               

              C) can you post the code for "redirects the page as well in the background.".

               

               

              Regards,

              Hoque

              • 4. Re: actionListener is not responding from af:commandButton in jsff
                Anujit

                Hi,

                 

                So our scenario is popup will show some data (in print popup) and in the background that same data will flushed out. I am not quite sure showPopupBehavior will solve that. Also cleaning project as well as tmp files makes no difference. I still don't know how come the pop up is coming up with data when the bean method is unreachable and commented.

                 

                Regards,

                Anujit