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

Ontonomo picture Ontonomo · Jul 29, 2011 · Viewed 8.2k times · Source

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>

Answer

dertkw picture dertkw · Jul 29, 2011

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>