• Post Reply Bookmark Topic Watch Topic
  • New Topic

a4j:support - Can I have multiple actions for the same event?  RSS feed

 
michelle wu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Is it possible to add two actions to a <h:selectOneMenu> on the event of "onchange". Are following ways eligible to use?

<a:support id="aaa" event="onchange" action='#{methodA(a); methodB}' ajaxSingle='false'/>

or

<a:support id="aaa" event="onchange" action='#{methodA(a)}' ajaxSingle='false'/>
<a:support id="aaa" event="onchange" action='#{methodB}' ajaxSingle='false'/>

Thanks.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first one is not proper JSF action invocation and if it works at all, it would only be because EL made it work, not JSF.

The second one will probably work. Try it. If it doesn't then you either are going to need to code an additional action method somewhere that calls the 2 methods or you'd have to use a set of ActionListeners. But let's hope you don't need listeners, since they would require recoding your backing-bean methods.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!