You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Kamal Bhatt <kb...@tt.com.au> on 2008/05/26 05:50:49 UTC

[CForms] Forcing validation in an action

Hi,
I would like to setup an action that forces validation, but does not 
necessarily save the form. Is there a way of doing this?

Cheers.

-- 
Kamal Bhatt


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [CForms] Forcing validation in an action

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Kamal Bhatt wrote:
> Hi,
> I would like to setup an action that forces validation, but does not
> necessarily save the form. Is there a way of doing this?
Yes, sure. In code handling action event you have an access to
"event"[1] variable that holds reference to WidgetEvent[2] instance. So
you can do something like:
event.getSourceWidget().getForm().validate();

HTH.

[1] http://cocoon.apache.org/2.2/blocks/forms/1.0/479_1_1.html
[2]
http://cocoon.apache.org/2.2/blocks/forms/1.0/apidocs/org/apache/cocoon/forms/event/WidgetEvent.html

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org