I have a problem with LiftScreen and Record. Errors occurring during the
validation of the submitted data don't get shown to the user. When I use
"lift:Msgs?showAll=true" I can see the validation messages. So I digged
into the code and saw this a few times:
def toForm: Box[NodeSeq] =
uniqueFieldId match {
case Full(id) => Full(elem % ("id" -> (id + "_field")))
case _ => Full(elem)
}
So the html element gets the id "foo_field" which is a problem since the
uniqueFieldId is "foo". Validation messages are of Type FieldError which
contain the uniqueFieldId "foo" and not "foo_field" and a message. So
the message cannot be associated with the html element and no error is
shown. I also looked at the Mapper code and saw that Mapper is using
just the uniqueFieldId. So there is no problem.
I uploaded a sample project on github:
https://github.com/justwrote/lift_screen_record_bug
Just do sbt, update, jetty-run. Open localhost:8080 in the browser and
submit the form without entering any data. You will see an error message
at the "ok" field and no message at the "fail" field. But both messages
are in the sidebar.
In Foo.scala you can see that I overwrote the toForm method for the "ok"
field so that it is working correctly.
I'm using Scala 2.8.1 and Lift 2.3-SNAPSHOT.
Thanks for your time
Dominik
Hi,I have a problem with LiftScreen and Record. Errors occurring during the
validation of the submitted data don't get shown to the user. When I use
"lift:Msgs?showAll=true" I can see the validation messages. So I digged
into the code and saw this a few times:def toForm: Box[NodeSeq] =
uniqueFieldId match {
case Full(id) => Full(elem % ("id" -> (id + "_field")))
case _ => Full(elem)
}
There you go.
https://www.assembla.com/spaces/liftweb/tickets/949-liftscreen--validation-errors-not-shown-when-using-record
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.