我试图在请求范围内将隐藏字段值设置为支持 bean,但我看到 setter 采用的值为空“”,尽管客户端有一个值(可以在 firebug 中看到)。在actionListener
调用之前,调用了 setter,但 plan 的参数为空。
<managed-bean>
<managed-bean-name>carController</managed-bean-name>
<managed-bean-class>com.domain.myproject.controller.CarController</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>plan</property-name>
<value>#{param.planUI}</value>
</managed-property>
</managed-bean>
public class CarController {
private String plan = "";
// getter and setter
}
main.xhtml
<h:form id="myForm">
<input type="hidden" name="planUI" id="planUI" value=""/>
....
<ice:panelGroup>
<ice:menuPopup id="popupmenu">
<ice:menuItem id="item1" value="item" immediate="true"
onclick="document.getElementById("myForm:planUI").Value = 'test';"
actionListener="#{someBean.listener}">
</ice:menuItem>
</ice:menuPopup>
</ice:panelGroup>