ok,,
I don't want to put them in a single snippet since I want to be able
to use them independently ..
I could call one snippet from the other I guess this would work but
just doesn't feel right... I would end up
having to do one snippet per page to control the subsnippets...
In fact i'm not sure how I can "compose" independent even non
stateful snippets... without having an enclosing
"controler" snippet
Best would be if non-stateful snippets could find each other for
example could I have something like
<lift::SnippetA>
<lift:SnippetB>
</lift:SnippetB>
</lift::SnippetA>
And have snippet B find the snippet A instance ? and modify it's
rendering based on it ? or something similar?
This way my list Invoice could know what it's in a AddInvoice
snippet and get the Client it must show the invoices for ..
And otherwise just render all invoices...
Having it in another context could make it render different
things...
Or would I really have to bind SnippetB inside SnippetA with
chooseTemplate and directly call it's functions with the arguments I
need ? and do this all top-down... rather then down-top...
So basically I guess the question is how do you manage multiple
snippets (non-stateful) so that they are the most independent from
each other and that code can reused and scoped properly if they have
any effect on each other and or that they can enclose each other...
Maybe I"m way off too ,, sorry , Help is much apreciated...
I will try the ajax way too, and I guess I could repost the
RequestVar.. need to try that too..
Thanks,
hexa
On Mar 10, 9:33 am, David Pollak <[email protected]>
wrote:
> The short answer is "no".
>
> The slightly longer answer is "Can you put both into a single snippet?"
>
> The even longer answer is "Have you tried using Ajax forms so you don't even
> leave the page?"
>
>
>
> On Tue, Mar 9, 2010 at 10:19 PM, hexa <[email protected]> wrote:
> > Hi,
> > I have 2 Stateful snippets in a page :
>
> > 1. a InvoiceList snippet that
>
> > 1. If no client RequestVar is present lists all the invoices in the
> > system
> > 2. If a client RequestVar is present lists the invoices for that
> > client
>
> > 2. a AddInvoice snippet that displays a form and adds an invoice
> > binded on the Client RequestVar..
>
> > Now these 2 can share the same RequestVar.. and that's fine for one
> > request
>
> > And at least in the case of 1 stateful snippet since I set the request
> > var to a class var , it persists after a submit on the AddInvoice...
> > the client persists
>
> > But for the other snippet .. the state is lost...
>
> > So is there a way to manage the common states of multiple snippets in
> > a page ? Should I use a SessionVar ? I kinda would prefer not to
> > since It's really not a var that should be persistent over the
> > session....
>
> > The best would be that they both keep their state .. as an action is
> > performed on one of them...
>
> > Thanks a lot
>
> > hexa
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<liftweb%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics
--
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en.