ice:selectOneMenu 发送错误的值
我的 JSF/ICEFaces 应用程序有多个下拉菜单,这些菜单相互更新,因此根据其中一个的选择,其他菜单的内容也会更新。
问题是菜单发送了错误的值。 看起来它发送的是之前的值而不是当前的值! 不知道为什么!
有任何想法吗?
谢谢,
谭
<td>
<ice:selectOneMenu id="selectCurApplNm"
value="#{statsDisplayAndFilter.applIDFilterPhrase}"
disabled="#{statsDisplayAndFilter.disableCurrentApplIdNamesMenu}"
valueChangeListener="#{statsDisplayAndFilter.fetchEventNames}"
partialSubmit="true" immediate="true">
<f:selectItem itemValue="" itemLabel="" />
<f:selectItem itemValue="all" itemLabel="all" />
<f:selectItems id="selectCurApplNmItems"
value="#{statsDisplayAndFilter.currentApplIdItems}" />
</ice:selectOneMenu>
</td>
</tr>
<tr>
<td>
<ice:outputLabel for="SlctCompTyp" value="Event Name: " />
</td>
<td>
<ice:selectOneMenu id="SlctCompTyp"
value="#{statsDisplayAndFilter.eventNameFilterPhrase}"
disabled="#{statsDisplayAndFilter.disableEventNamesMenu}"
valueChangeListener="#{statsDisplayAndFilter.fetchMethodNames}"
partialSubmit="true" immediate="true">
<f:selectItem itemValue="" itemLabel="" />
<f:selectItem itemValue="all" itemLabel="all" />
<f:selectItems id="SlctcompTypeItms"
value="#{statsDisplayAndFilter.eventNameItems}" />
</ice:selectOneMenu>
</td>
</tr>
I have multiple drop down menus with my JSF/ICEFaces application that update each others so depending on the selection of one the contents of others update.
The problem is that the menu is sending the wrong value. It seems it sends the value before instead of the current one! not sure why!
Any ideas?
Thanks,
Tam
<td>
<ice:selectOneMenu id="selectCurApplNm"
value="#{statsDisplayAndFilter.applIDFilterPhrase}"
disabled="#{statsDisplayAndFilter.disableCurrentApplIdNamesMenu}"
valueChangeListener="#{statsDisplayAndFilter.fetchEventNames}"
partialSubmit="true" immediate="true">
<f:selectItem itemValue="" itemLabel="" />
<f:selectItem itemValue="all" itemLabel="all" />
<f:selectItems id="selectCurApplNmItems"
value="#{statsDisplayAndFilter.currentApplIdItems}" />
</ice:selectOneMenu>
</td>
</tr>
<tr>
<td>
<ice:outputLabel for="SlctCompTyp" value="Event Name: " />
</td>
<td>
<ice:selectOneMenu id="SlctCompTyp"
value="#{statsDisplayAndFilter.eventNameFilterPhrase}"
disabled="#{statsDisplayAndFilter.disableEventNamesMenu}"
valueChangeListener="#{statsDisplayAndFilter.fetchMethodNames}"
partialSubmit="true" immediate="true">
<f:selectItem itemValue="" itemLabel="" />
<f:selectItem itemValue="all" itemLabel="all" />
<f:selectItems id="SlctcompTypeItms"
value="#{statsDisplayAndFilter.eventNameItems}" />
</ice:selectOneMenu>
</td>
</tr>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现当它调用 valueChangeListener 中定义的方法时,该值尚未绑定到正确的变量,因此我必须使用事件变量来获取新值:
这解决了问题
I found out that by the time it calls the method defined in valueChangeListener the value is not yet binded to the proper variable so I had to use the event variable to get the new value:
And this solved the problem