Ok; I now have:

<fd:on-value-changed>
<fd:_javascript_>
 var thisWidget = event.source;
 if ( thisWidget.getValue() == "" ) {
   thisWidget.setState ( WidgetState.ACTIVE)
 }  else  {
  thisWidget.setState ( WidgetState.OUTPUT)
 }
</fd:_javascript_>
</fd:on-value-changed>
 
But I get  a "Reference error: WidgetState is not defined"; searching
the archives also revealed an unanswered problem:
 
Any light on this aspect? 
Thanks.

>>> [EMAIL PROTECTED] 2005/11/04 11:38 AM >>>
Derek Hohls wrote:
> Thanks guys, what you say makes sense... but my "widget"
> grammer is a little limited still; would the syntax be something
> like:

> <fd:field id="key" required="true">
>  <fd:on-value-changed>
>   <_javascript_>
>  
although <_javascript_> works, please use <fd:_javascript_>

>    var thisWidget = event.source.lookupWidget("key");
>  
Your "key" widge is simply "event.source"

>    if ( thisWidget.value() == "" ) {
>  
use either "thisWidget.value" or "thisWidget.getValue()". You may also
want to test against null

>      thisWidget.setState ( WidgetState.ACTIVE)
>    }  else  {
>     thisWidget.setState ( WidgetState.OUTPUT)
>    }
>  
Yep!
>   </_javascript_>
>  </fd:on-value-changed>
> </fd:field>
>
>  
Sylvain

--
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
This message is subject to the CSIR's copyright, terms and conditions and e-mail legal notice.
Views expressed herein do not necessarily represent the views of the CSIR.

CSIR E-mail Legal Notice

CSIR Copyright, Terms and Conditions

For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR Legal Notice
send a blank message with "REQUEST LEGAL" in the subject line to CSIR HelpDesk


This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.