Hi,
as a lift-scala-newbie i am trying out various things with lift to see
advantages etc. to other frameworks (rails, grails,...)
I am now trying to integrate a third party java validation library and
i want to embed the results into my webapp. First i want to put all
localized error messages into the error object, which seems to be
straightforward and i am not expecting any problems there.
my second step would be a integration with the binding to visualize
input/textareas depending on their validation results. My problem is
now the lifecycle of my snippet.
object name extends RequestVar("")
//someCode
def submit() { //validation would happen here }
bind("myobject", xhtml, "name" ->
SHtml.text(name.is, name(_),
("class","dependsOnTheValidationResult"),
"submit" -> SHtml.submit("submit", submit)
)
My problem is, that the binding to the form happens at the same time
as the binding to the request vars. So it seems like there is no
simple way to:
1. read the vars
2. bind them to an object
3. validate the object
4. bind the validation result to the css attributes of the elements
AND: This should only happen when the user submits. Because there is
no need to validate when the user hits the page the first time. Should
i create 2 pages (one for the first view, one for the validation
cycle, separate binding methods,...). This seems not to be a DRY way.
Any suggestions or best practices?
thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---