[Lift] Re: How do I properly read a value from a cookie?

2009-11-16 Thread Sergey Andreev
ies. I need its value, or null if there's no cookie. Why > not do something a-la RoR: > > S.cookieValue("cookieName") > > or a-la ASP.NET: > > val c = S.cookie("cookieName") > if(c != null) { > val v = c.value > } > > Or, indeed, both

[Lift] Re: How do I properly read a value from a cookie?

2009-11-16 Thread Sergey Andreev
Hi, For-comprehensions could help you out: for{ cookie <- S.findCookie(cookieName) value <- cookie} doSomethingWithValue Regards On Mon, Nov 16, 2009 at 12:07 PM, DMB wrote: > > When I call findCookie it returns a Box. Then, the value on the cookie > itself is also a box. Hence a ruby one

[Lift] Re: Box and Option - what am I missing?

2009-05-04 Thread Sergey Andreev
Import net.liftweb.util.Box._ and you should get option2Box implicit On Mon, May 4, 2009 at 5:44 PM, TSP wrote: > > I've a function that returns an Option. How do I turn it into a box. > I'm told there are implicit functions to do so, so why doesn't the > following code work and what do I need t

[Lift] Re: Object typecast to Mapper

2009-04-20 Thread Sergey Andreev
Hi Amit, Try that one def bindObject[T <: AnyRef](className: Class[T]): Option[Object] = { val sClassName = className.getPackage.getName.concat(".Wrap".concat(className.getSimpleName)) try { Some(Class.forName(sClassName.replaceFirst("com.vtech", "com.vtech.appxtension")).newInsta

[Lift] Re: StatefulSnippet Beginner

2009-04-18 Thread Sergey Andreev
Could you attach a sample code which doesn't work? On Sat, Apr 18, 2009 at 8:41 PM, bradford wrote: > > I have "changed class Products {" to read "class Products extends > StatefulSnippet {" > > Instead of S.redirectTo, I now have this.redirectTo and it still > doesn't seem to be saving the sta

[Lift] Re: Constructor for Req in custom dispatch functions

2009-04-15 Thread Sergey Andreev
Look at the unapply method on a Req object On Wed, Apr 15, 2009 at 4:17 PM, Heiko Seeberger < heiko.seeber...@googlemail.com> wrote: > Hi, > In the current version of Exploring Lift Listing 3.20 shows an example of a > custom dispatch function: > > LiftRules.dispatch.append { > case Req(chart :

[Lift] Re: Custom Boot Class

2009-03-16 Thread Sergey Andreev
broke when we moved to a Filter... > > Derek > > > On Mon, Mar 16, 2009 at 7:02 AM, Jorge Ortiz wrote: > >> I get the same error, unfortunately. >> >> --j >> >> >> On Mon, Mar 16, 2009 at 4:48 AM, Sergey Andreev wrote: >> >>> Jorge

[Lift] Re: Custom Boot Class

2009-03-16 Thread Sergey Andreev
Jorge, I am using a custom Boot class and it works just fine. I believe that if you create a Brat.scala and put your class there, it will solve the problem Regards, Sergey On Mon, Mar 16, 2009 at 1:31 PM, Jorge Ortiz wrote: > Folks, > > I'm trying to specify a custom Boot class, as per Chapter

[Lift] Re: submit and redirect

2009-02-02 Thread Sergey Andreev
There were no errors on the console. And the state was persisted when i was using Marius's example. So it looks like a bug to me. Thanks, Sergey On Mon, Feb 2, 2009 at 6:09 PM, Tim Perrett wrote: > > > Lift will still indeed notify you of an error invoking a snippet. > > On 02/02/2009 15:01, "De

[Lift] Re: submit and redirect

2009-02-01 Thread Sergey Andreev
The problem has nothing to do with templates names. I was writting ... Capitalizing the first letter in the snippet's name () solved the problem. Anyway looks like a bug =) Regards, Sergey On Sun, Feb 1, 2009 at 7:09 PM, Sergey Andreev wrote: > Derek, > I was commenting out ever

[Lift] Re: submit and redirect

2009-02-01 Thread Sergey Andreev
page. That >> > should allow access to the same var. I just coded up a test app >> (attached) >> > and it works fine using very similar code. >> > >> > On Fri, Jan 30, 2009 at 12:36 AM, Marius >> wrote: >> > >> > > On Jan

[Lift] Re: submit and redirect

2009-01-30 Thread Sergey Andreev
> > > On Thu, Jan 29, 2009 at 1:54 PM, Sergey Andreev wrote: > >> Hi Liftlers, >> I am migrating one of my application to the lift as a way to learn it and >> i would like to ask a question. >> >> After submitting a form i would like to do a redirect and

[Lift] Re: submit and redirect

2009-01-30 Thread Sergey Andreev
wrote: > > > > On Jan 30, 9:36 am, Marius wrote: > > On Jan 29, 10:54 pm, Sergey Andreev wrote: > > > > > > > > > Hi Liftlers, > > > I am migrating one of my application to the lift as a way to learn it > and i > > > would like to

[Lift] bug in mixinAttributes

2009-01-30 Thread Sergey Andreev
Hi, I have encountered a bug in the mixinAttributes method If you put the following xml in the template: and bind it like that: bind("data", xhtml, "textBoxes" -> mixinAttributes(text("",)) _) then the attributes won't be merged. Whereas, if you change the template: attributes ar

[Lift] submit and redirect

2009-01-29 Thread Sergey Andreev
Hi Liftlers, I am migrating one of my application to the lift as a way to learn it and i would like to ask a question. After submitting a form i would like to do a redirect and show the submitted values on the other template. I have 2 templates and i use the same snippet in both of them to render