我想在会议上通过所选的无线电塔顿值。 我的法典不会奏效。
这里的观点(Person.xhtml):
<h:form>
<h:selectOneRadio id="searchRadio" value="#{controller.radioButtonFlag}" valueChangeListener="#{controller.selectRadioButton}" >
<f:selectItem itemValue="fachid" itemLabel="#{msg.fachId}">
<f:attribute name="radioButtonField" value="fachid" />
</f:selectItem>
<f:selectItem itemValue="vngw" itemLabel="#{msg.VNGW}">
<f:attribute name="radioButtonField" value="vngw" />
</f:selectItem>
</h:selectOneRadio>
... <h:commandButton action="#{controller.search}" value="#{msg.search}"></h:commandButton>
这里是经过管理的星号:
@ManagedBean @SessionScoped public class Controller { private String radioButtonField = "fachid"; private boolean VNGWSelected = false; public void selectRadioButton(ValueChangeEvent event){
String select = (String) event.getComponent().getAttributes().get("radioButtonField");
if(select.equals("vngw"))
VNGWSelected = true;
} public String search() {... if(!VNGWSelected){logger.info("FachID RadioButton selected."); else{... logger.info("VNGW RadioButton selected."); ...} return "personsearch"; } ...} ... }
请允许我告诉我,我在这里做了什么错误?
提前感谢。