On Sat, 2003-07-19 at 23:41, Eric Gulatee wrote: >> >> Now basically my problem is that I want to be able >> to hook into my own validation routines on top of >> Woody's. [If you're registering a user, you need to >> verify the name is available]... Now I've noticed >> that if you hook into your own form handler >validation >> doesn't occur.
>that's on purpose Well, I extended the Form Handler and WoodySubmitAction [something like that] to be able to do just that. My scenario being a typical registration, you need to validate that the username has not been taken, however you still want to do the normal validation on the form. So I extended a few classes in order to do this. But I was hoping that I could use the widgets to create a ValidationError but this is all hidden as you say yet once you do this custom validation you need to be able to select a widget and add a custom error message. >> >> How about adding a few methods to the FormHandler >> interface in order that the form can query it whether >> or not the handler can do extra validation. (I will >> do this for my own project unless someone wakes me up >> and informs me there is a better way :)) >It's been the intention all along to add something >like that, it just >hasn't been done yet. I haven't put much thought to it yet. >What I think would be needed is: >* an extra validate() method on the FormHandler (which will then likely >be split into two interfaces: FormEventHandler and >FormValidationHandler) which will be called after the >default validation >succeeds. I've done this by extending FormHandler and WoddySubmitAction... >* A way to set the validation error of a widget, i.e. >add a >setValidationError method to the Widget interface. >Currently the fact >that widgets can have validation errors is an >implementation detail of >the widget itself. >Another possiblity would be to make these form->specific validations >behave like other validation rules. I.e. you declare >them in the >formdefinition, but their implementation would then >call a method on >your custom FormValidationHandler. Yeah, I looked into trying to define a custom validation rule that hooks into your own code for validation. But I haven't done this yet. >> >> Secondly what happens if you have two woody forms >> on the same page? When I started I had a login form >> on my left menu and the user could also register in >> the center pane and when submitting both forms would >> try to validate... >I don't understand your question. Are you describing >a problem or is >this something you'd like to do? This is a program I encountered, say I have a login form on the leftmenu and the users select registration from the menu which displays in the center pane [keeping the left menu there with the login form] well once the user click on Register then both forms are validated! Eric. __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
