Problem with LiftScreen, Record and FieldError

94 views
Skip to first unread message

Dominik Schmidt

unread,
Feb 28, 2011, 3:30:36 PM2/28/11
to Lift
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)
}

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

David Pollak

unread,
Mar 24, 2011, 8:55:39 AM3/24/11
to lif...@googlegroups.com, Dominik Schmidt


On Monday, February 28, 2011 12:30:36 PM UTC-8, Dominik Schmidt wrote:
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)
    }


Looks like a bug.  Please open a ticket (http://ticket.liftweb.net you must be a watcher of the LiftWeb space on assembla to open tickets), assign it to me and mark it for 2.3-release.

Thanks.
 

Dominik Schmidt

unread,
Mar 24, 2011, 11:25:54 AM3/24/11
to lif...@googlegroups.com

David Pollak

unread,
Mar 24, 2011, 12:46:29 PM3/24/11
to lif...@googlegroups.com

Tnx. 
 
--
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.




--
Lift, the simply functional web framework http://liftweb.net
Reply all
Reply to author
Forward
0 new messages