cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: [RT] Flowmaps revisited
Date Wed, 10 Oct 2001 14:08:18 GMT
"Tom Klaasen (TeleRelay)" wrote:
> 
> Hi,
> 
> I'm impressed... This would even solve problems I've got now with Struts
> (which is concentrating solely on webapp development)
> 
> One point though: you should work out point "(6): form submits" some
> more . Form validation is *the* PITA in webapp development, not in the
> least because the user wants to see some feedback about what he did
> wrong. I don't see that in your solution (but then again, I still have
> to see the first webapp framework that solves this properly. My hopes go
> to XForms, because I've done some pretty nice things with that).

Currently, most validation is done automatically by the FormValidationAction,
which works in conjunction with the form-validation logicsheet.  The actual
validation work is done in the action--which if the page does not validate
correctly, resends the current page--with the additional markup from the
logicsheet.  The tutorial has a good example.

The Sitemap looks like this:

<map:match pattern="form-page.html">
  <map:action type="validate">
    <map:parameter name="descriptor" value="context://form-descriptor.xml"/>

    <!-- this happens on success -->
    <map:redirect-to url="next-page.html">
  </map:action>
  <map:generate type="serverpage" source="form-page.xsp"/>
  <map:transform source="form2xhtml"/>
  <map:serialize/>
</map:match>


The descriptor takes care of constraints and validation sets.
Inside the XSP page you would find entries like this:

<textbox name="number" caption="Enter a Number" value="0"/>
<formval:on-toobig name="number">
  <error>
    The number you entered was too big.
  </error>
</formval:on-toobig>
<formval:on-toosmall>
  <error>
    The number you entered was too small.
  </error>
</formval:on-toosmall>


That way, the contents inside the formval tags will embed the
markup enclosed based on the type of validation.  This makes it easy to
manage the error message based on validation violation.

> On a second level, have you thought about multi-page forms (one form is
> filled out in multiple stages. There _are_ situations where you want to
> do that) and multi-form pages (several forms on one page, and depending
> on which form you press "submit" on, you go to a different location)?

The Flowmap approach would take the sitemap entry above, and manage
the flow/state transition between each page in the form.

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


Mime
View raw message