开发者

How to know which item is clicked in richfaces PickList

开发者 https://www.devze.com 2023-04-11 19:56 出处:网络
I am using richfaces 4.1.0M2 with JSF2.0 and I have a PickList and what I want is that when someone selects (mouse click) an item in the left list, some component in the form is updated based on what

I am using richfaces 4.1.0M2 with JSF2.0 and I have a PickList and what I want is that when someone selects (mouse click) an item in the left list, some component in the form is updated based on what is clicked. I have managed to trigger an event in the bean whan some one clicks on an item. The code to achieve the trigger is

<rich:pickList showButtonsLabel="false" value="#{groupBean.pickListResult}"
                                    listHeight="100"  converter="#{groupBean.converter}">
                                    <a4j:ajax event="click" render="userlist" limitRender="true" listener="#{groupBean.updateGroupMembers}"/> 
                                    <f:selectItems value="#{groupBean.leftPickList}" />
                       </rich:pickList>

But I am not able to get the value of SelectItem which was clicked. Any idea how I can do that. I read in the documentation that each item has th开发者_如何学运维ree states associated with it in the PickList i.e common, selected, active. So is there a way to get these states in the bean. Any idea.


The selected value will be available in groupBean.pickListResult (on the server)


I Think you Should use onchange Event in <a:support>

ex: <a4j:ajax event="onchange" render="userlist" limitRender="true" />
0

精彩评论

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