如何知道在 richfaces PickList 中单击了哪个项目
我正在使用带有 JSF2.0 的 richfaces 4.1.0M2,并且我有一个 PickList,我想要的是,当有人选择(鼠标单击)左侧列表中的某个项目时,表单中的某些组件会根据单击的内容进行更新。当有人点击某个项目时,我成功地触发了 bean 中的一个事件。实现触发器的代码是
<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中得到这些状态呢?任何想法。
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 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
所选值将在 groupBean.pickListResult 中可用(在服务器上)
The selected value will be available in groupBean.pickListResult (on the server)
我认为你应该在
中使用onchange
事件I Think you Should use
onchange
Event in<a:support>