Description
valueChangeListener is being called before the setters, even with immediate="true".
This is not the right behavior since it overwrites any property modified in the event handler.
<t:panelGrid columns="2" cellpadding="0" cellspacing="5px" columnClasses="left top, left top">
<t:outputLabel for="infoId" value="Options"/>
<t:selectOneMenu id="infoId" value="#
" onchange="submit()" valueChangeListener="#
{productBean.valueChangedHandler}" immediate="true">
<f:selectItem itemValue="-1" itemLabel="<new short info>"/>
<f:selectItems value="#
"/>
</t:selectOneMenu>
<t:outputLabel for="descText" value="Description"/>
<t:inputTextarea id="descText" rows="8" value="#
"/>
<t:outputLabel for="utilText" value="Usage"/>
<t:inputTextarea id="utilText" styleClass="wXXXL" rows="8" value="#
"/>
</t:panelGrid>
public class ProductBean {
private Long infoId;
private String description;
private String usage;
// .... setters and getters for the above properties
public void valueChangedHandler(ValueChangeEvent event) {
Long infoId = (Long) event.getNewValue();
if ((infoId != null) && (infoId > 0))
}
}
Description and Usage properties can never be changed since they get overwritten with the initial values.
((((((((((((((((((((((((