On Nov 3, 5:15 pm, Tim Perrett <[EMAIL PROTECTED]> wrote:
> +1.
>
> Any given persistence provider back-end (like yo say, LDAP, JPA etc)
> should be required to implement these as part of there implementation.
> I don't think they should have a default behavior however...
>
> Now wanting to open another pandora's box, but out of interest, how
> will the validation stuff tie into the Record?

The best answer would be to look at the code :) ... but in a glance
here it is:

1. For each Field you can add virtually any number a validation
functions. Each validation function takes parameter the type of the
field (Int, Long String etc.) and returns a Can[Node]. If Can is Empty
the validation passed. Otherwise the  Node impersonates the error text
that will be shown as validation message.
2. In the validation function you have access to all other Record
fields if you have fields dependency validation.
3. When you call validate on a record it will subsequently call all
validators for each field and Return a List[FieldError]. having this
list you can pass it to S.error for example in order to set the
validation messages into the form

I could probably send you off line later on today a code example.

>
> Sounds like things are moving on swimmingly. Great work guys!
>
> Cheers, Tim
>
> On 3 Nov 2008, at 13:33, Marius wrote:
>
> > Derek, they are separated. Record itself has no idea about DB.
> > Nevertheless save/update/delete semantic applies for any possible
> > backend (LDAP, JDO, RDBMS ... you name it). So I wonder if save/
> > delete/
> > update should exist in Record as "dummy" or as they are today only on
> > DBRecord. Personally I prefer them the way they are today (in
> > DBRecord) ... but other people may feel different so I'm opened for
> > valid arguments.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to