[Lift] Re: Prepare StatefulSnippet in advance

2009-08-05 Thread David Pollak
Please provide a complete (executable) code sample so I can understand the flow. On Wed, Aug 5, 2009 at 9:40 AM, Naftoli Gugenheim naftoli...@gmail.comwrote: Hi. I have one screen, /requests/edit, that links to /clients/edit, in order to edit a specific client. Both use StatefulSnippet. In

[Lift] Re: Prepare StatefulSnippet in advance

2009-08-05 Thread Naftoli Gugenheim
I don't have code available to post right now, but let me try to explain better. Basically you're editing a request, which is associated with a client. Now when your entering the request you may notice that the client's info is wrong. So I need a link to the client editing page, which is

[Lift] Re: Prepare StatefulSnippet in advance

2009-08-05 Thread David Pollak
Create a top-level RequestVar: object TheClient extends RequestVar[Box[Client]](Empty) object ReturnToMe extends RequestVar[Box[() = Unit]](Empty) class ClientEditor extends StatefulSnippet { val referer = S.referer openOr / val client = TheClient.is openOr {S.error(client not provided);

[Lift] Re: Prepare StatefulSnippet in advance

2009-08-05 Thread David Pollak
On Wed, Aug 5, 2009 at 1:25 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: I have working now by instantiating a client snippet class and calling S.mapSnippet with the snippet's edit method. But why didn't it work by calling its registerThisSnippet method? because the snippet didn't know

[Lift] Re: Prepare StatefulSnippet in advance

2009-08-05 Thread Naftoli Gugenheim
Okay, that makes sense! I guess it's generated during the xml processing stage? - David Pollakfeeder.of.the.be...@gmail.com wrote: On Wed, Aug 5, 2009 at 1:25 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: I have working now by instantiating a client