3

can a4j:support have more than one value in the event attribute?

<a:support event="onchange, onsubmit" ajaxSingle="true"
action="#{customerSession.userCheckQuantity(_cartItem, index)}"
reRender="shoppingCartAjax, orderTotalAjax"></a:support>
Ontonomo
  • 527
  • 1
  • 8
  • 12

2 Answers2

4

No, you can't. In the TLD for the event attribute it says:

Name of JavaScript event property ( onclick, onchange, etc.) of parent component, for which we will build AJAX submission code

There has been a JIRA requesting this feature, but it's still open. Since it's for RF3, I'm guessing this won't change.

However there is another request for a4j:ajax (equivalent in RF4) supporting the same thing. Since it's for RF4, I'm guessing it's more likely to get implemented.

As an alternative, you can just use multiple a4j:support tags for one compoent:

<h:selectOneMenu id="planets" value="#{planetsMoons.currentPlanet}" valueChangeListener="#{planetsMoons.planetChanged}">
    <f:selectItems value="#{planetsMoons.planetsList}" />
    <a4j:support event="onchange" reRender="id1,id2" />
    <a4j:support event="onkeyup" reRender="id1,id3" />
</h:selectOneMenu>
dertkw
  • 7,798
  • 5
  • 37
  • 45
0

You can use actionparam for this, here is an example:

< a4j:commandButton ajaxSingle="true" value="Clean Up Form" reRender="name, job, out"  status="commonstatus">

                <a4j:actionparam name="n" value=""  assignTo="#{userBean.name}" />

                <a4j:actionparam name="j" value=""  assignTo="#{userBean.job}" />

< /a4j:commandButton>

similar for a4j:support

Hemant Metalia
  • 29,730
  • 18
  • 72
  • 91
Ramin Mir.
  • 784
  • 1
  • 7
  • 18
  • is it possible to declare more then one a4j:actionparam? In my case it doesn't work – Mary Feb 29 '20 at 22:41