PickList中单击了哪个项目

PickList中单击了哪个项目

本文介绍了如何知道在richfaces PickList中单击了哪个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有 JSF2.0 的 Richfaces 4.1.0M2 并且我有一个 PickList,我想要的是当有人选择(鼠标单击)左侧列表中的一个项目时,表单中的某些组件会根据点击.我设法在单击某个项目时在 bean 中触发了一个事件.实现触发器的代码是

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>

但是我无法获得被点击的 SelectItem 的值.任何想法我怎么能做到这一点.我在文档中读到,每个项目在 PickList 中都有三个与其相关的状态,即普通、选定、活动.那么有没有办法在 bean 中获取这些状态.任何想法.

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 three 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.

推荐答案

I Think you should use onchange Event in

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

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

这篇关于如何知道在richfaces PickList中单击了哪个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 12:31