Hi Rafael,
 
 
you're right, the JSF EL syntax must be used. The information on the jsValueChangeListener Web page of the Apache MyFaces Web site seems out-dated or obsolete:
 
http://myfaces.apache.org/tomahawk/_javascript_Listener.html
 
But despite of using the JSF EL syntax, the approach used to react to value change events of radio button selections seems not to work. The first click shows a reaction, setting false in the inputText. All following selections doesn't change the inputText - true can never be set in the inputText, although the selectOneRadio, which is the parent of the jsValueChangeListener, has 4 radio buttons.
 
 
<t:jsValueChangeListener for="" 
    property="value"  
    expressionValue="#{srcElem[2].checked ? 'true' : 'false'}" />
 
 
Regards,
Matthias
 
-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von Rafael Nami
Gesendet: Donnerstag, 1. Dezember 2005 12:36
An: MyFaces Discussion
Betreff: Re: jsValueChangeListener - how to detect radio button selections

Did you tried using #{srcElem[2].checked ? 'true' : 'false'} instead of $srcElem[2].checked ? 'true' : 'false' ??

Best Regards

Rafael Mauricio Nami

2005/11/30, Matthias Kahlau <[EMAIL PROTECTED]>:
Hi!


I tried to use the t:jsValueChangeListener to react, when a specific radio
button is selected or deselected, but got the following errors in the
Firefox 1.0 _javascript_ console (but didn't also work in Internet Explorer
6):


uncaught exception: Error encountered : srcElem has no properties
undefinedSource-Element id: _id1:ergPubBeginnRadios
Source-element: null
Type of source-element: object


I used the following approach inside a selectOneRadio (with
id="ergPubBeginnRadios") just to test:

<t:jsValueChangeListener for=""
        property="value"
                expressionValue="$srcElem[2].checked ? 'true' : 'false'" />


Does anybody know what's wrong?


Regards,
Matthias


Reply via email to