val startDateField = S.text(startDate, startDate = _) % new
UnprefixedAttribute("id", "startdate", Null)
And then reference the id with some javascript in the xhtml template. I
feel like doing it this way may be somewhat brittle (and dirty) since
now I technically have code in the template; I believe ithat's something
we're trying to avoid here. I'm trying to figure out if there may be
some way to unobtrusively add support directly in lift for controlling
form behavior. Another thing that might be useful if we're going to add
in javascrip support is having client-side form validation. From my
brief reading of the Mapped* classes, it appears that they do a little
validation, but I think it might be useful to have validation support a
little lower level. I'm just starting to think about this, so if there
is already support for this and I've overlooked it then please let me
know. I'm also not entirely convinced that it would be good to add this
support to lift, so I'll listen to arguments on either side.
Cheers,
Derek
I don't know the current architecture. (I work on clientside validation for JSF (2 years ago), and currently implements a solution for Wicket 1.3 and jquery validation framework).
My basic suggestion is to have a "Collection[Validator]".
* The collection could be filled handly (ex: validators.add(myValidator)) or by a AutoValidators (helper that add Validators to the collection from binded field meta data (Mapper info, hibernate
annotations, ...)
* Validator must provide a read-only api :
* to provide information for end-user message (if validator failed)
* to allow ClientSideValidator to be created and mimic server side configuration => hook to parse collection[Validator], and to insert in the generated html the configuration, js lib, css,...
* to allow AutoValidators to avoid put twice the same validator :)
Feedback messages should be filled by server or by client
there are 2 groups of validators : before convertion (only work on String) and after convertion (work on other type : int,Date,...)
My current skills (scala and liftweb) don't allow me to suggest some code.
My 2cents (requirements).
/david B.
I put up a page on the wiki to allow us to design this feature:
http://liftweb.net/index.php/Unified_Validation
Can folks post requirements, suggested implementations and pointers to
how other frameworks handle this on that page?
Thanks,
David
--
After some thought and some private email exchanges, I've changed my
mind about moderating every post.
A huge thanks to the folks who are helping guide me and a big thanks
to the community as a whole.
David
Sometimes a graph is better than text, could you install graphviz extension[1] (or similar) into the wiki ?
[1]:
http://www.wickle.com/wiki/index.php/Graphviz_extension
Thanks,
/david B
I really recommend using Graphviz whenever you have to output some
kind of graph. The DOT format is extremely simple and perfectly
adequate for a logging facility related to some kind of graph data
structure.
Cheers,
Julien