Derek Hohls wrote:
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:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=112178872110129&w=2
<http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=112178872110129&w=2>
Any light on this aspect?
You have to learn how to reference a Java class from JavaScript with its
full class name :-)
This is "setState(org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE)"
Alternately, you can also
"importClass(org.apache.cocoon.forms.formmodel.WidgetState)" either in
your event handler or in the flowscript that shows the form, if you're
using flowscript.
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]