[ 
http://issues.apache.org/jira/browse/MYFACES-1492?page=comments#action_12449262 
] 
            
Mario Ivankovits commented on MYFACES-1492:
-------------------------------------------

I've never seen valueChangeEvents fired during the "invoke application" phase, 
and yes, I too think the documentation is wrong here. See [1] for a 
documentation with what matching my knowledge.

So, one solution can be to use the valueChangeNotifier (tomahawk sandbox), its 
events are fired AFTER the update model phase (regardless of the immediate 
attribute) and thus should work as expected.

Hope this helps ...

[1] 
http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps%7Ceventvalidate%7Csf_aev_valuechange~html/

> 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
>            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

        

Reply via email to