[ http://issues.apache.org/jira/browse/MYFACES-1492?page=comments#action_12449348 ] Mircea Zahan commented on MYFACES-1492: ---------------------------------------
Ok, let me summarize, looks like some people do not read carefully :( 1. I tried calling renderResponse() from inside the listener, it's not helping because the getters won't get called. So it's useless. 2. I emphasize the following piece from the doc I pasted: "If this attribute is set to "true", these methods are fired instead at the end of the "apply request values" phase." In real life, the immediate attribute has no effect on the time the event is fired. The way I see it the doc is right and the implementation is wrong. It's common sense. I don't care "this is the nature of the JSF life cycle", firing the event before the setters it's plain wrong. So, will you choose doing some quality work or will you choose getting stuck in fixed ideas ? And yes, I'm a little bit stressed because, in my opinion, you didn't consider to realy understand the problem, which, in some users' opinion, is critical, hence the priority of the issue. Just google for this one, see how big is the issue. I really hope this is not my last post here, but it's certainly going that direction. Thank you for your time. Special thanks to Mario Iankovits, the only one who really did read what I was writing. > valueChangeListener is being called before the setters, even with > immediate="true" > ---------------------------------------------------------------------------------- > > Key: MYFACES-1492 > URL: http://issues.apache.org/jira/browse/MYFACES-1492 > Project: MyFaces Core > Issue Type: Bug > Components: General > Affects Versions: 1.1.4 > Reporter: Mircea Zahan > Assigned To: Cagatay Civici > Priority: Critical > Fix For: 1.1.4 > > > 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="#{productBean.infoId}" > onchange="submit()" valueChangeListener="#{productBean.valueChangedHandler}" > immediate="true"> > <f:selectItem itemValue="-1" itemLabel="<new short info>"/> > <f:selectItems value="#{productBean.shortInfoSelectItems}"/> > </t:selectOneMenu> > <t:outputLabel for="descText" value="Description"/> > <t:inputTextarea id="descText" rows="8" > value="#{productBean.description}"/> > <t:outputLabel for="utilText" value="Usage"/> > <t:inputTextarea id="utilText" styleClass="wXXXL" rows="8" > value="#{productBean.usage}"/> > </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)) { > //DataService and ProductInfo are related to Hibernate > ProductInfo info = DataService.getProductInfo(infoId); > this.description = info.getDescription(); > this.usage = info.getUsage(); > } > } > } > Description and Usage properties can never be changed since they get > overwritten with the initial values. > :((((((((((((((((((((((((( -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
