I tried this before but failed(see my first mail in this thread),but today I found the key:
I change import url in jx_template from
<jx:import uri="resource://org/apache/cocoon/forms/generation/template.jx"/>
to:
<jx:import uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml"/>
the state invisibled work.
jx-macros.xml is the new file in 2.1.6,can it replace template.jx?
Roy Huang
about widget's state.From: Sylvain Wallez <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Question and Suggessions about forms block in 2.1.6 Date: Fri, 26 Nov 2004 12:50:17 +0100
roy huang wrote:
>Hi,Sylvain:
> I have thought about invisible state,and studied the mail archive
> Is it now I can't just use flowscript to hide a widget ? > >
Sorry, I don't understand the question. Are you asking how to hide a widget in flowscript?
First, you have to make the WidgetState class visible: importClass(org.apache.cocoon.forms.formmodel.WidgetState);
then you can use one of the constants defined by that class to set the state of a widget.
form.lookupWidget("my-field").setState(WidgetState.INVISIBLE);
Note that this is not limited to the flowscript, and can only be used in event handlers.
Hope this helps. Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com
