提交/下一步时获取 null
我正在使用 primefaces 向导。在向导流程中,所有参数均已正确保存。但是
项目在提交时获取 NULL。同样在“返回”时,它不会显示我选择的内容。
也一样。有什么解决办法吗?
这是代码片段。我使用 primefaces-3.0.M3 和 jsf2。
<h:outputText value="Employee Status" />
<p:selectOneMenu id="employeeStatus"value="#{employeeRepositoryImpl.employeeStatus.title}">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItem itemLabel="Permanent" itemValue="Permanent" />
<f:selectItem itemLabel="Contract" itemValue="Contract" />
<f:selectItem itemLabel="Part-Time" itemValue="Part-Time" />
<f:selectItem itemLabel="Training" itemValue="Training" />
</p:selectOneMenu>
<p:message id="employeeStatusId" for="employeeStatus" />
这是在
选项卡中,单击下一步按钮或提交按钮时,itemValues 变为 null。抱歉重新发布。
I am using primefaces wizard. During wizard flow all parameters saved correctly . However <p:selectOneMenu>
items getting NULL on submit.Also on 'back', it will not show what I have selected. Same for <p:selectManyMenu>
also. Any solution ?
Here is the code snippets.I'm using primefaces-3.0.M3 and jsf2.
<h:outputText value="Employee Status" />
<p:selectOneMenu id="employeeStatus"value="#{employeeRepositoryImpl.employeeStatus.title}">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItem itemLabel="Permanent" itemValue="Permanent" />
<f:selectItem itemLabel="Contract" itemValue="Contract" />
<f:selectItem itemLabel="Part-Time" itemValue="Part-Time" />
<f:selectItem itemLabel="Training" itemValue="Training" />
</p:selectOneMenu>
<p:message id="employeeStatusId" for="employeeStatus" />
This is in a <p:wizard>
tab, while clicking next button or submit button, the itemValues getting null.Sorry for the re-post.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
之前的帖子删了吗?
无论如何,首先,您应该升级到
Primefaces 3.0.M4
!其次,最好将列表与
f:selectItems
一起使用,并将所有这些字符串值存储在列表中(这样您就可以更多地控制)列表以及列表应该返回什么),但如果您想坚持使用f:selectItem
,请尝试将其与封闭标签一起使用(没有它可能是一个错误):另外,我再说一遍,升级到Primefaces 3.0.M4!
Have you deleted the previous post?
Anyway, firstly, you should upgrade to
Primefaces 3.0.M4
!Secondly, it would be better to use a list along with
f:selectItems
and all those String values to be stored in a list(this way you have more control over what's in the list and what should the list return), but if you want to stick withf:selectItem
try using it with the enclosing tag (it may be a bug without it):Also, I repeat myself, upgrade to Primefaces 3.0.M4!
使用 primefaces AJAX 解决了这个问题,并在
employeeStatusAjax()
中检查/处理了这个问题。我已经通过在
中
I have solved it by using primefaces AJAX
inside my
</p:selectOneMenu>
and I check/process this in sideemployeeStatusAjax()
.