cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: CForms - different views of the same widget
Date Fri, 04 Nov 2005 09:38:19 GMT
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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message