所以,我有
<p:ajax event="tabChange" listener="#{refriedBean.onTabChange}" />
不过,我想通过在tabChange事件,并存储在页面上一个额外的价值
But I want to pass in the tabChange event AND an extra value that is stored on the page
public void onTabChange(TabChangeEvent event, Object obj)
如何将一去这样做呢?
How would one go about doing this?
您可以替换参数 OBJ
与附加属性在bean并设置必要的价值对Ajax请求该属性
You can replace argument obj
with additional property in bean and set needed value to this property on ajax request:
<p:ajax event="tabChange" listener="#{refriedBean.onTabChange}">
<f:setPropertyActionListener target="#{refriedBean.additionalProperty}" value="value_here"/>
</p:ajax>
请参阅setPropertyActionListener