Custom Form Validator

2006-01-04 Thread Dustin N. Jenkins
Does anyone have experience writing Custom Form Validators?  We need a 
way of accessing our Spring Service Layer from one of our Cocoon Custom 
Validators, but the Validator doesn't seem to have access to the HTTP 
Request or Session or anything else that's exterior to it.  Is there an 
easy way of acquiring the Spring Application Context or the HTTP Request 
that someone knows of?


Many thanks,
Dustin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom Form Validator

2006-01-04 Thread Sylvain Wallez

Dustin N. Jenkins wrote:
Does anyone have experience writing Custom Form Validators?  We need a 
way of accessing our Spring Service Layer from one of our Cocoon 
Custom Validators, but the Validator doesn't seem to have access to 
the HTTP Request or Session or anything else that's exterior to it.  
Is there an easy way of acquiring the Spring Application Context or 
the HTTP Request that someone knows of?


If you use flowscript, you can write a custom validator in Javascript. 
It will have access to the "cocoon" object and all global variables of 
the flowscript.


Sylvain

--
Sylvain WallezAnyware Technologies
http://bluxte.net http://www.anyware-tech.com
Apache Software Foundation Member Research & Technology Director


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Custom Form Validator

2006-01-05 Thread Ard Schrijvers
You can put fd:validation in you form. For example, start you fd:form with

http://apache.org/cocoon/forms/1.0#definition"; 
xmlns:i18n="http://apache.org/cocoon/i18n/2.1";>

  
  return messageValidator(widget);
 



and in flow

function messageValidator(form){
 var date = form.lookupWidget("removeDate").getValue();
  var now = new Date();
  if (date.before(now)){
var validationError = new ValidationError("yi!");

form.lookupWidget("removeDate").setValidationError(validationError);
  }
return (!date.before(now));
}

AS

> 
> 
> Dustin N. Jenkins wrote:
> > Does anyone have experience writing Custom Form Validators? 
>  We need a 
> > way of accessing our Spring Service Layer from one of our Cocoon 
> > Custom Validators, but the Validator doesn't seem to have access to 
> > the HTTP Request or Session or anything else that's 
> exterior to it.  
> > Is there an easy way of acquiring the Spring Application Context or 
> > the HTTP Request that someone knows of?
> 
> If you use flowscript, you can write a custom validator in 
> Javascript. 
> It will have access to the "cocoon" object and all global 
> variables of 
> the flowscript.




> 
> Sylvain
> 
> -- 
> Sylvain WallezAnyware Technologies
> http://bluxte.net http://www.anyware-tech.com
> Apache Software Foundation Member Research & Technology Director
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom Form Validator

2006-01-05 Thread Dustin N. Jenkins

Thanks to the responses, that's what I needed!



Dustin N. Jenkins wrote:

Does anyone have experience writing Custom Form Validators?  We need a 
way of accessing our Spring Service Layer from one of our Cocoon 
Custom Validators, but the Validator doesn't seem to have access to 
the HTTP Request or Session or anything else that's exterior to it.  
Is there an easy way of acquiring the Spring Application Context or 
the HTTP Request that someone knows of?


Many thanks,
Dustin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Dustin N. Jenkins
Application Developer
Invoq Systems, Inc.
AlarmPoint - Guaranteed Event Resolution
#216 - 852 Fort Street
Victoria, BC V8W 1H8
Tel: (250) 380-0304
[EMAIL PROTECTED] 
http://www.invoqsystems.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]