I have a situation where there is selectOneMenu that has a value associated with bean support.
I need a button that does not update the model values ββ(therefore, it has the property immediately = "true").
This button action method changes the value that is bound to selectOneMenu, but when the page is redrawn, the original value (the one that was sent) is displayed, not the one set in the action method.
Any ideas why this is happening?
If I do not explain the problem well enough, let me know.
<h / "> EDIT: As requested, the source code is here:
page code:
<h:selectOneMenu id="selectedPerson" binding="#{bindings.selectPersonComponent}" value="#{bean.selectedPerson}"> <s:selectItems var="op" value="#{bean.allPersons}" label="#{op.osoba.ime} #{op.osoba.prezime}" noSelectionLabel="#{messages.selectAPerson}"> </s:selectItems> <f:converter converterId="unmanagedEntityConverter" /> </h:selectOneMenu> ... <a4j:commandButton action="#{bean.createNew}" value="#{messages.createNew}" immediate="true" reRender="panelImovine"> </a4j:commandButton>
Java code:
private Person selectedPerson; public String createNew() { log.debug("New created..."); selectedPerson = null; bindings.getSelectPersonComponent().setSubmittedValue(null);
The solution is in the aligned sign DECISION :)
ivans
source share