Is it possible to have multiple actionListeners on a command button?
If not is there any way around this?
Thanks for your help!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, you can only add two server-side callback methods:
actionListenerandaction.<ice:commandButton action="#{bean.navigateTo}" actionListener="#{bean.doSomething}"/>actionListenerhas to point to a public method which returnsvoidand takes an ActionEvent as an argument. It is generally used for any tasks which are not related to any navigation logic and has the advantage, to provide you with the old and new (= changed) value of the control. This makes particular sense in input controls like checkboxes.actionhas to point to a public method which returns aStringwithout taking any arguments. The method will do everything what is needed for navigating – for example additional validation (if it hasn’t been handled by some basic JSF validator). The outcome has to match the navigation rules fromfaces-config.xml.That should give you enough possibilities to handle multiple tasks (which I assume is your reason for having multiple actionListener) within your server logic.
Additionally, if you need to do only some client-side tasks, you can take advantage of several on* JavaScript properties.
Reference: ICEfaces Custom Components Taglib