简体   繁体   English

使用PrimeFaces 3.3.1(JSF 2.0)通过p:ajax发送额外参数

[英]Send an extra parameter through p:ajax with PrimeFaces 3.3.1 (JSF 2.0)

is there any way to send extra parameters with p:ajax? 有没有办法用p:ajax发送额外的参数?

I got this: 我懂了:

<p:selectOneMenu id="crit">
    <f:selectItem itemLabel="Select one..." itemValue="0" />
    <f:selectItems itemLabel="#{cat.desc}" itemValue="#{cat.id}" value="#{CatBean.cats}" var="cat" />
    <p:ajax event="change" listener="#{ConsBean.proccesCatSelection}" process="crit" update=":list,:crits" />
</p:selectOneMenu>

I need to send an ID with the event "change" but it seems to send only an AjaxBehaviorEvent. 我需要发送一个带有“更改”事件的ID,但它似乎只发送一个AjaxBehaviorEvent。

Thanks a lot for the attention. 非常感谢您的关注。

put the ID in an InputHidden and then use this : 将ID放入InputHidden ,然后使用:

<p:ajax event="change" listener="#{ConsBean.proccesCatSelection}" 
process="crit inputHiddenId" update=":list,:crits" />

Then p:ajax will send the InputHidden content to server too. 然后p:ajax也会将InputHidden内容发送到服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM