cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: Event handling in Woody
Date Sun, 28 Sep 2003 16:42:47 GMT
Andreas Hochsteger wrote:

> Hi Sylvain!
> Sylvain Wallez wrote:
>> <snip/>
>> I solved points 3&4 as follows :
>> - <wd:action> are considered as "intra-form" actions : they never 
>> validate and always redisplay the form
>> - <wd:submit> (new widget that extends action) are considered as 
>> "form-exit" actions. They have an additional "validate" attribute 
>> that define if form validation should occur (true by default). For 
>> example, this allows a "cancel" button to be written as <wd:submit 
>> id="cancel" validate="false"/>
> Would it be possible (perhaps in the future) to handle those 
> intra-form actions completely on the client (eg. via JavaScript)?
> Imagine using some DHTML to add or delete rows...
> Not that I'd need it right now, but I'm just curious, if you thought 
> about something like that.

Yes, I thought about that, and I even wrote some add/remove stuff for 
XMLForm before switching to Woody. But this can be very tricky to do as 
it highly depends on how the form widgets map to HTML code.

And since this mapping is defined by the form template, you can't rely 
on the fact that a repeater is laid out in a particular way. This could 
be done, however, if the layout of a repeater was templated using a new 
instance-only widget like the wi:group defined in "woody-page-styling.xsl".

Now the repeaters are only a small part of event-handling, as actions 
can be used to do many other things such as getting the (parsed and 
validated) value of other fields, accessing application data, etc. This 
server-side event handling allow to simply define complex form 
interactions at the cost of a roundtrip to the server. I'm currenlty 
investingating in moving form styling on XSL-enabled clients (Mozilla 
and IE6) which would speed up this rountripping.

Now handlers involving widgets only (and not app-data) may be sent to 
the client, but this would require to reconsitute an equivalent of the 
form model on the client. Not easy, but I'm not a client-side JS 
expert... Want to give it a try ?


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -

View raw message