Thanks .. read that ...and look and dmap implementation however it
doesn't work like I expected:


scala> r.dmap("application/octet-stream")(_.contentType.is)
res49: java.lang.String = null

scala>

There should be "application/octet-stream" result

scala> s.dmap("app")(_.contentType.is)
res50: java.lang.String = image/jpeg

scala>

That is OK - contentType exists ..


I tried .toString but doesn't work either ..

Best regards,

On 26 Lis, 11:52, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:
> Marcin Jurczuk <mjurc...@gmail.com> writes:
> > Hello,
>
> > Can someone point me how to access data from Box object return by
> > mapper query:
>
> [...]
>
> > scala> var r = RejDocBin.find(By(RejDocBin.DocBinId,4))
> > r: net.liftweb.common.Box[pl.com.company.model.RejDocBin] = Full
> > (pl.com.company.model.RejDocBin=
> > {docbin...@1c10834,docbinid=4,contenttype=image/jpeg,description=})
>
> > scala>
>
> > I need to retrieve contenttype field and check if it is not null
> > However how to get by RejDocBin object from Box ?
> > Best regards,
>
> There have been many discussions about Box on the list, searching the
> archives will bring a lot of info :-)
>
> You can "unpack" a box in several ways, one is like this:
>
> r.dmap("Empty contenttype")(_.contenttype.is)
>
> or
>
> r.open_! (but this is discouraged use, will throw if the box is empty)
>
> Note Box is similar to Scala's option, so you might take a look here
>
> http://blog.lostlake.org/index.php?/archives/50-The-Scala-Option-clas...
>
> /Jeppe

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@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