One thing I've been thinking about is optionally extending the Validator
Functions to also emit JavaScript that would perform the validation in the
browser... that would provide a seamless way to do client-side validation
for validators (e.g., min len, max len, regex) that only rely on client-side
data.

On Fri, May 29, 2009 at 6:32 AM, Oliver Lambert <olambo...@gmail.com> wrote:

> Hi Marius,
> To try and answer your question, I had to go and look at the Record code
> in
> more detail. I hadn't recently written the Binder Validator, so it wasn't
> designed to be
> complementary to anything else (however, some of the naming and methodology
> is very
> similar in both sets of code).
>
> What I found.
> 1) MetaRecord.validate     === Binder.validate
> 2) Field.validators             === BoundObj.validations
> 3) Field.validationFunction === Validator.validate
> 4) List[FieldError]              === List[ValidationError]
>
> Can I get rid of Binder Validation and just use Record/Field validation?
> It certainly looks like I should try. However, I might have to add/change
> some of the original Lift code.
> For instance, I might want to add an errorType (with a default, so no code
> is broken) to FieldError.
> I might also want to move/change Field.validationFunction so its a little
> more
> like my Validator,with an errorType and toString (When I print my
> validators, the errorType give a little
> information on what they do, rather than just telling me I have a function
> - I also filter using
> the errorType)
>
> Other things of interest that I found.
>
> Could a Binder be a MetaRecord? There are definitely some similarities.
> Binder holds a set of
> immutable objects which can be an advantage, but MetaRecord can talk to
> databases which is
> kind of useful at times.
>
> Could a BoundObj be a Field. Same distinction as above. A BoundObj[T] may
> hold a reference to a string value
> that is completely invalid. I'm not sure I see this in Field.
>
> cheers
> Oliver
>
> On Fri, May 29, 2009 at 6:22 PM, marius d. <marius.dan...@gmail.com>wrote:
>
>>
>> I see ... still the question remains. What are we going to do with two
>> validators? I'd like to understand the principles of your addition
>> (... I know I should have dig into the code but I don't have much time
>> now).
>>
>> I'd like to understand as I said previously if we have redundant
>> validators or complementary functionality so that people to not get
>> confused.
>>
>> I'm not trying at all to be negative or anything, just trying to
>> understand the value added.
>>
>> Br's,
>> Marius
>>
>> On May 29, 11:01 am, Oliver Lambert <olambo...@gmail.com> wrote:
>> > I'm aware of S.error and my ValidationError uses it when I'm ready to
>> show
>> > errors. I've briefly looked at the ValidationFunction and the thing I
>> might
>> > stumble on is the errorType which I rely on.
>> >
>> > I may be able to refactor the code to use List[FieldError] as I don't
>> think
>> > I rely on errorType at this point.
>> >
>> > I'll have a go at modifying the Binder code.
>> >
>> > cheers
>> > Oliver
>> >
>> > On Fri, May 29, 2009 at 5:05 PM, Marius <marius.dan...@gmail.com>
>> wrote:
>> >
>> > > Oliver,
>> >
>> > > I very briefly looked on your code and I saw that you have your own
>> > > validator there. How would that play with the existent validattors
>> > > that Record has where each field has a list of :
>> >
>> > > type ValidationFunction = MyType => Box[Node]
>> >
>> > > Note that current MetaRecord's validator after evaluating the
>> > > validators for each field it yields a List[FieldError] which can be
>> > > easily naturally used with S.error function to show the error messages
>> > > etc.
>> >
>> > > Is there a redundancy or complementary functionality?
>> >
>> > > Br's,
>> > > Marius
>>
>>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to