-1
我試圖在請求範圍中設置隱藏字段值來支持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>
我想我將不得不使用cookie裏面的單引號。 –