If you know the Box is full you can write open_! (you'll get a runtime error if 
it wasn't). Otherwise openOr a default, e.g., an invalid id.
You have first answer the question, what _should_ happen if it's Empty after 
all? :)
-------------------------------------
Peter Robinett<pe...@bubblefoundry.com> wrote:


Everyone, I apologize for monopolizing the list but this has been very
helpful for me. I've learned a bunch from similar, old entries in the
list and hope this thread will help future Lift beginners.

On to my reply to David:

On Jul 1, 4:19 pm, David Pollak <feeder.of.the.be...@gmail.com> wrote:
> Yes, the reference contained a Loc, but the compiler could not verify that
> it contained a Loc.  At compile time, the compiler knows the common
> superclass between Loc[_] and String is Object.  Thus the type of l in your
> code was Object and Object doesn't have the foundParam method.

Ooooohhhh! Ok, that makes a lot of sense.

> I'd put your snippet in your Loc.  That way you have access to the
> foundParam.
>
> Loc.Snippet("time", time)
>
> And then in your Loc, you put the time method below.  In that case, you'll
> have direct access to foundParam without any goofiness.

To be honest, this doesn't make a lot of sense to me. I assume you
mean a Loc in the Menus of my SiteMap that I assemble in Boot.scala.
I'm using the Locs created by the CRUDify trait added to my Node model
so I guess I would have to override the Node.menus method. I think
I'll delve into this more later when it's necessary...

> You could also write this as:
>
> override val data = Packet.findAll(By(Packet.node, for (req <- S.request;
> loc <- req.location) yield loc.asInstanceOf[Loc[Node]].foundParam.is),
> MaxRows(1000)....

Ok, this makes sense but unfortunately the value yielded by the for
comprehension is all boxed up and so I get an error:
error: no implicit argument matching parameter type
(net.liftweb.util.Box[net.liftweb.util.Box
[com.equalnetworks.model.Node]]) => Long was found.
                override val data = Packet.findAll(By(Packet.node, for (req <-
S.request;

What would be the best way to unbox things to get the actual Node
object so I can have a Long to put in my By() call?

Thanks,
Peter


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to