JSF access html element value in bean class

后端 未结 2 1927
情深已故
情深已故 2020-12-20 07:35

I have a JSF application in which I have a combo box.



        
2条回答
  •  無奈伤痛
    2020-12-20 07:53

    Because Process Events happens before Update Model Values you can retrieve the value from the component, from the UIViewRoot like this:

    HtmlSelectOneMenu collectorTypeSelectMenu = (HtmlSelectOneMenu) FacesContext.getCurrentInstance().getViewRoot().findComponent("editForm:collectorType");
    String collectorType = (String) collectorTypeSelectMenu.getValue();
    

提交回复
热议问题