You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by ABOUSSOROR El Arbi <el...@sogeti.com> on 2010/07/29 11:18:46 UTC

MyFaces 1.2 : attribute valueChangeListener

Hi,

 


  I've seen in the MyFaces 1.2 that the
EditableValueHolder.setValueChangeListener method is deprecated and we
should now use addValueChangeListener(MethodExpressionValueChangeListener)
instead.


See:
http://myfaces.apache.org/core12/myfaces-api/apidocs/index.html?javax/faces/
component/UIComponent.html


So when I use the tag selectOneMenu with the attribute valueChangeListener
the listener is added to the selectOneMenu component, wright ?


<h:selectOneMenu value="#{flightController.selectedFlightCode}" 

                        onchange="submit()"

 
valueChangeListener="#{flightController.changeSelectedFlightCode}"

 
valueChangeListener="#{flightController.changeSelectedFlightCode2}">


                  <f:selectItems value="#{flightController.flightCodes}" />


 


But it seems that this is not the correct syntax :-(


.


 


Re: MyFaces 1.2 : attribute valueChangeListener

Posted by Jakob Korherr <ja...@gmail.com>.
Hi,

You can only add one ValueChangeListener via the valueChangeListener
attribute on the tag. If you want to add more than one you have to add
<f:valueChangeListener /> tags as children to your <h:selectOneMenu />.

Here you can find the documentation of <f:valueChangeListener/>:
http://myfaces.apache.org/core12/myfaces-impl/tlddoc/f/valueChangeListener.html

Regards,
Jakob

2010/7/29 ABOUSSOROR El Arbi <el...@sogeti.com>

> Hi,
>
>
>
>
>  I've seen in the MyFaces 1.2 that the
> EditableValueHolder.setValueChangeListener method is deprecated and we
> should now use addValueChangeListener(MethodExpressionValueChangeListener)
> instead.
>
>
> See:
>
> http://myfaces.apache.org/core12/myfaces-api/apidocs/index.html?javax/faces/
> component/UIComponent.html<http://myfaces.apache.org/core12/myfaces-api/apidocs/index.html?javax/faces/%0Acomponent/UIComponent.html>
>
>
> So when I use the tag selectOneMenu with the attribute valueChangeListener
> the listener is added to the selectOneMenu component, wright ?
>
>
> <h:selectOneMenu value="#{flightController.selectedFlightCode}"
>
>                        onchange="submit()"
>
>
> valueChangeListener="#{flightController.changeSelectedFlightCode}"
>
>
> valueChangeListener="#{flightController.changeSelectedFlightCode2}">
>
>
>                  <f:selectItems value="#{flightController.flightCodes}" />
>
>
>
>
>
> But it seems that this is not the correct syntax :-(
>
>
> .
>
>
>
>
>


-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at