ValueCell - An Empty Box was opened error

19 views
Skip to first unread message

Omar Otoniel Soto

unread,
Sep 19, 2015, 12:25:40 PM9/19/15
to Lift
Hello there!

I'm learning how to work with ValueCell's. Unfortunelly, all I get is this error message:

ERROR net.liftweb.http.LiftRules - Exception being returned to browser when processing /pos/cash
java.lang.NullPointerException: An Empty Box was opened.  The justification for allowing the openOrThrowException was Legacy method implementation
        at net.liftweb.common.EmptyBox.openOrThrowException(Box.scala:697)
        at net.liftweb.common.EmptyBox.openOrThrowException(Box.scala:665)
        at net.liftweb.common.Box.open_$bang(Box.scala:291)
        at net.liftweb.common.Box.get(Box.scala:302)

I have a ValueCell defined as
       private val cantidadValue = ValueCell[Box[Double]](Empty)

When I want to use it
       val subtotal = latestElement.lift(cantidadValue){
            _.item.obj.get.price.toDouble * _.openOr(0d)
        }

I got the error...

Even if I change ValueCell[Box[Double]](Empty) to ValueCell[Box[Double]](Full(0d)) I got the same error

Any idea?

Andreas Joseph Krogh

unread,
Sep 19, 2015, 12:35:55 PM9/19/15
to lif...@googlegroups.com
What is _.item.obj in "_.item.obj.get.price" ?
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 

Omar Otoniel Soto

unread,
Sep 19, 2015, 7:51:23 PM9/19/15
to Lift
Doing some tests, I found that _.item.obj returns a Box. And it seems that _ doesn't have any value assigned at that time.

I will keep doing some tests with ValueCell
Reply all
Reply to author
Forward
0 new messages