You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Paul Bowler <pa...@www.aventix.co.uk> on 2003/05/13 16:14:17 UTC

Get error from FormValidatorAction

I have simple form validation working correctly, however when validation fails I need to gather more information about 
the failure to pass back to the user.

I don't want to use XSP, so how can I get this failure info via the sitemap or another action?

Thanks,

Paul.

--
Paul Bowler
Aventix Associates Ltd

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


Re: Get error from FormValidatorAction

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 13.May.2003 -- 03:42 PM, Paul Bowler wrote:
> I'm using 2.1.
> 
> I can see no additional request parameter being added, which is contrary to the documentation. The parameters passed 
> as part of the initial form request are added though.

request _attribute_ != request _parameter_

> I've tried using <error> tags with the SimpleFormTransformer, but these just get ignored!
> 
> Anyone got either of these two methods working?

Paul,

There's a sample hidden in 2.1 which is unfortunately broken -- I've
just corrected the paths to the stylesheets. So, update from CVS,
rebuild, run the servlet, and go to

http://localhost:8888/samples/simpleform/sform
http://localhost:8888/samples/simpleform/formval

The first sample is not finished (haven't gotten around to it) and is
overly complex as it performs an additional trick. It should get you
going anyway. Note that an error message is shown on the first visit
of the page because validation fails for the required parameter.

The second sample uses a logicsheet approach.

HTH.
	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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


Re: Get error from FormValidatorAction

Posted by Paul Bowler <pa...@www.aventix.co.uk>.
I'm using 2.1.

I can see no additional request parameter being added, which is contrary to the documentation. The parameters passed 
as part of the initial form request are added though.

I've tried using <error> tags with the SimpleFormTransformer, but these just get ignored!

Anyone got either of these two methods working?

Many thanks,

Paul.

On Tue, 13 May 2003 16:27:43 +0200, Christian Haul wrote
> On 13.May.2003 -- 03:14 PM, Paul Bowler wrote:
> > I have simple form validation working correctly, however when validation fails I need to gather more information 
about 
> > the failure to pass back to the user.
> > 
> > I don't want to use XSP, so how can I get this failure info via the sitemap or another action?
> 
> The action puts everything into request attributes. Don't know the
> actual structure off head. It might be possible to access it through
> the request-attribute input module, a custom input module, or a custom
> action.
> 
> In 2.0.4 there's a transformer that allows to include error tags
> depending on the error condition and to fill the form with values from
> the request (so the user does not need to re-enter the data). I'd
> advise to use the 2.0.5-dev or later variant of this transformer, though.
> 
> 	Chris.
> -- 
> C h r i s t i a n       H a u l
> haul@informatik.tu-darmstadt.de
>     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08



--
Paul Bowler
Aventix Associates Ltd

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


Re: Get error from FormValidatorAction

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 13.May.2003 -- 03:14 PM, Paul Bowler wrote:
> I have simple form validation working correctly, however when validation fails I need to gather more information about 
> the failure to pass back to the user.
> 
> I don't want to use XSP, so how can I get this failure info via the sitemap or another action?

The action puts everything into request attributes. Don't know the
actual structure off head. It might be possible to access it through
the request-attribute input module, a custom input module, or a custom
action.

In 2.0.4 there's a transformer that allows to include error tags
depending on the error condition and to fill the form with values from
the request (so the user does not need to re-enter the data). I'd
advise to use the 2.0.5-dev or later variant of this transformer, though.

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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