A few more questions: What does the attribute validator="val" refer to? The name of the Validator-class including package?
void doAssertValidity(String value) throws ValidationException: - "value" is the content of the submitted form-field, right? - if the validation fails I need to throw a new ValidationException? - how would you suggest to store the PK that I retrieve in this method and that I need later to store in the BO? user.Temp? Do I need one Validator class for each of the fields where custom validation is needed, or can I use one class for multiple validations? (I suspect I need one class for every single kind of validation.) Last but not least: how do I specifiy the error-message that should be displayed if validation for this field fails? Usually this is stated like this: <rule>Error-Message</rule>, but if I don't use the rule-element where do I put the message ... Marc > -----Ursprungliche Nachricht----- > Von: Quinton McCombs [mailto:[EMAIL PROTECTED]] > Gesendet: Donnerstag, 16. Januar 2003 00:06 > An: Turbine Users List > Betreff: RE: Intake question: how to add custum rule functions ? > > > Okay. All that you need to do is create a new Validator inheriting from > DefaultValidator that will do what you want. You validation code will > go in doAssertValidity(). > > If the call to group.isAllValid() works, then just get the object and > map to to the group. You will not have to get the field and the > validator objects. > > I know of no problems with Intake redisplaying the data. If you run > into this, please let me know. > > > -----Original Message----- > > From: Marc Lustig [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, January 15, 2003 4:57 PM > > To: Turbine Users List > > Subject: AW: Intake question: how to add custum rule functions ? > > > > > > > Out of curiousity, what sort of rules are you wanting to add > > > dynamically? > > > > For now what I need is to look up in another table if the > > data entered into the field exists or not. If it exists, I > > need the PK of that corresponding row to set in the > > object/property that is mapped to the field. (I suspect that > > will not work using group.setProperties(myBO), but I guess I > > can set it explicitly afterwards.) > > > > If the field doesn't exist, the validation should fail and > > the page redisplayed with all the values that were previously > > entered. Btw, is that working with current Intake? I read on > > the list that Intakte won't redisplay the data properly. > > > > Not quite sure what you mean with "dynamically". I need the > > same rule everytime I validate using this Group. Not sure > > what is dynamic about that... > > > > > > Marc > > > > > > -- > > To unsubscribe, e-mail: > > <mailto:turbine-user-> [EMAIL PROTECTED]> > > For > > additional commands, > > e-mail: <mailto:[EMAIL PROTECTED]> > > > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
