cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piroumian, Konstantin" <>
Subject Re: [C2] actions, forms, etc.
Date Thu, 31 May 2001 08:16:53 GMT
> > I started to look at the C2 framework, to see if it was finally getting
> > the state where I could start porting some of my existing webapps over
> > C2. And I'm a bit confused about the current state of the Action
> > framework...
> >
> <snip/>
> > So, to work around this problem, I would propose to inverse the
structure of
> > the sitemap in the case of form validation:
> >           <map:act type="check for form values">
> >             <!-- form values not ok, redirect back to form. error
> > information is passed in with the objectmodel -->
> >           </map:act>
> >           <!-- form values ok, save the data-->
> >
> > What do you think? Does this approach have any disadvantages?
> > If not, then I would propose to convert the current examples to this new
> > approach (I can help also, if needed).
> >
> actually we have previously came to another point. You are true that
> actions now return nothing when validation fails, this will be changed so
> action will return special configurable param to the sitemap indicating
> the result of validation was and which parameters where wrong (this param
> later be used in param-selector), this way we
> just need to figure out how these wrong parameters propagate nicely back
> the form, an XSP solution would be great but how to pass action's Map
> to XSP efectively ??

Why not to use request attributes and place a HashMap with error messages
My approach is this:

1. Form validator action validates posted data, creates some object (some
XML 'instance data' if it's not present yet) and places error messages (or
only error codes) there. Then that 'instance data' is added to the request

2. A form navigator action checks the result (some error flag in the
objectModel) and depending on the result returns a 'nextpage' param.

3. Every form is processed by a FormTransformer which replaces special
output tags (e.g.: <output ref="errors/error[@id='password']'" />)  by the
error message from the 'instance data' according to the 'ref' attribute.

4. ??? Who must remove/clean instance data?

(Some ideas was taken from the W3C XForm Specification)

> > Neeme
> martin

Any comments on this approach?


To unsubscribe, e-mail:
For additional commands, email:

View raw message