cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raphaël Piéroni <raphael.pier...@aql.fr>
Subject Re: [Cocoon 2.2 + Cforms] Validation a field using the Databas e
Date Thu, 08 Nov 2007 09:18:29 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Grzegorz Kossakowski a &eacute;crit&nbsp;:
<blockquote cite="mid4732C7BC.8070800@apache.org" type="cite">
  <pre wrap="">Rapha&euml;l Pi&eacute;roni pisze:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Thanks for the answer.

Is this functionnality avaliable in 1.0.0-RC1 ? It seems not.

When that new version wil be released ?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
As I pointed out, Spring-based Forms will be released as 1.1.0. I don't know what are current
plans
and if there any show-stoppers for 1.1.0's first milestone release. I guess it's better to
ask on
dev list. Hint: usually pleasant bugging developers to push the release can give good result.
;)

  </pre>
</blockquote>
Meanwhile having the springified validator, i added them myself in the
flowscript<br>
like in :<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var form = new Form("view/user/create.cform");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var validator = spring.getBean("createUserValidator");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; form.lookupWidget('userName').addValidator(validator);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; form.lookupWidget('unixLogin').addValidator(validator);<br>
<br>
In the validator i do :<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ValidationError error = new
ValidationError("error.createUser.userName", true);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
((Field) widget).setValidationError(error);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
&nbsp;&nbsp; return false;<br>
<br>
I saw (using logs) that the validation is false (which is what i test)<br>
But the form completes as if it was validated.<br>
<br>
Rapha&euml;l<br>
<br>
<blockquote cite="mid4732C7BC.8070800@apache.org" type="cite">
  <pre wrap="">Anyway, you can still develop Avalon-based validator using 1.0.0-RC1
version of Forms. The choice is
yours.

  </pre>
</blockquote>
<br>
<br>
</body>
</html>

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


Mime
View raw message