What version of MyFaces has this tag available ?

-----Original Message-----
From: Martin Marinschek [mailto:[EMAIL PROTECTED]
Sent: Friday, December 17, 2004 8:38 AM
To: [EMAIL PROTECTED]
Subject: New tag - jsValueChangeListener


A new tag is available - x:jsValueChangeListener, use it to execute a
javascript expression when the value of a component has changed.

You can now execute simple java-scripts without knowing the id's of
components, you just reference the component with '$destElem'
(component which will be affected by the value change listener) and
'$srcElem' (component where the value change event originated from).

usage examples as follows:

<x:jsValueChangeListener for="text2" property="value"
expressionValue="($srcElem.value=='yes')?'true':'false'" />

<x:jsValueChangeListener for="text3" property="value"
expressionValue="$srcElem.value" />

<x:jsValueChangeListener for="text4"
expressionValue="$destElem.innerHTML = $srcElem.value" />

<x:jsValueChangeListener for="text5"
expressionValue="($srcElem.value=='hide')?$destElem.style.display='none':$destElem.style.display='inline'"
/>

Check out the source from apache and look into the examples section
for a test drive...

By the way - thanks to Sylvain for his resource-filter implementation,
great work! It is real easy to handle the inclusion of resource-files
now; deployment has been simplified by a great deal!

regards,

Martin

Reply via email to