StatefulSnippet example is in now.
On Sat, Apr 18, 2009 at 8:44 PM, Derek Chen-Becker wrote:
> I'll add in an example for StatefulSnippet. We have one already in
> PocketChange, so I just need to copy the code listing in. You should be able
> to mix the two as you see fit.
>
> Derek
>
>
> On Sat,
Still have to do StatefulSnippet, but the example of passing info in a
RequestVar (listing 3.24) is updated to show a redirectTo example as well.
Derek
On Sat, Apr 18, 2009 at 8:44 PM, Derek Chen-Becker wrote:
> I'll add in an example for StatefulSnippet. We have one already in
> PocketChange, s
I'll add in an example for StatefulSnippet. We have one already in
PocketChange, so I just need to copy the code listing in. You should be able
to mix the two as you see fit.
Derek
On Sat, Apr 18, 2009 at 6:58 PM, bradford wrote:
>
> Thanks, Derek. I read the updated PDF version of the book on
Thanks, Derek. I read the updated PDF version of the book on "The
Lift Book" group. I think it looks good. I think an example with
redirectTo may be better than link. Also, personally, I'm not sure if
I understand StatefulSnippet now. It doesn't seem like you can mix
the two. I updated my co
OK, I just added some more explanation on passing state between snippets to
section 3.15 in the book. I just uploaded a new PDF. When you have a chance
could you look at it and let me know if that makes sense? Also, I wasn't
sure if this should be a separate section ("Passing Data Between Snippets"
A RequestVar is only "live" for the duration of the request, and a
redirectTo ends up sending a 307 temp redirect to the browser, which results
in a new request. S.redirectTo does have an overload that allows you to pass
a function that will be called when the redirected request is handled. Some
sk
Thanks, Tim. I worked around that issue.
I would still like to know whether or not it's possible have
RequestVars carry over to the redirected page. I'm attaching a
modified demo. If I use just a var, it will maintain the state. If I
use RequestVar, it won't transfer the state.
Well.. I coul
Its talking about Hibernate session, not lift session. Perhaps you have a
detached model or something your trying to work on?
Cheers, Tim
On 18/04/2009 19:08, "bradford" wrote:
> no session or session was
> closed
>
> I'll look into this some more.
--~--~-~--~~~--
Thanks, Sergey. When I removed the reuqestVar, changing these two
lines
object productVar extends RequestVar(new Product())
def selectedProduct = productVar.is
to
var selectedProduct = new Product()
It worked. Now I'm having a Hibernate problem.
Message: org.hibernate.LazyInitializationExce
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
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 state.
On Apr 17, 10:55 pm, Derek Chen-Becker wrote:
> OK, first, your snippet class needs to extend StatefulSnip
OK, first, your snippet class needs to extend StatefulSnippet. Then you need
to define the dispatch partial function to tell it which snippet goes to
which function, and then you need to use StatefulSnippet.link and
StatefulSnippet.redirectTo instead of SHtml.link and S.redirectTo,
respectievly.
D
I guess it would help to mention that is on
index.html and is on select.html.
On Apr 17, 9:45 pm, bradford wrote:
> I'm trying to play around with the StatefulSnippets and can't get it
> to hold state. This is what I have for a test:
>
> class Products {
> object productVar extends RequestV
13 matches
Mail list logo