开发者

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

开发者 https://www.devze.com 2023-03-24 01:02 出处:网络
can a4j:support have more than one value in the event attribute? <a:support event开发者_运维知识库=\"onchange, onsubmit\" ajaxSingle=\"true\"

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>


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>


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

0

精彩评论

暂无评论...
验证码 换一张
取 消