Ok i think I see the "bug". It is the magic which i don't understand
yet that if you change your client_id from val to var it will be auto
promoted into Heap and live out Snippet. Try this out.

Change:
val client_id = clientBox map (_.id.toLong)
To:
var client_id = clientBox map (_.id.toLong)

On Mar 9, 3:34 pm, hexa <[email protected]> wrote:
> Hi, thanks for the suggestions I like that match  {} code.. will try
> that..
>
> But what you suggest but the post_id is similar to what I'm doing
> now.. since this id is a long it will be copied by value
> and I can pass it to multiple requests using a closure...
>
> I'll try to clarify a bit :
>
> A have  a ViewClient snippet and an AddInvoice snippet
>
> In the ViewClient I add the action AddInvoice  which must be bound to
> a client..
>
> Now passing the client to the AddInvoice form is ok .. I can send the
> whole client object to the form snippet using a RequestVar..
> which I find kinda neet not having to go trough thoses ids... (maybe
> i'm wrong thinking that)
>
> But the trick is now that i'm in the AddInvoice snipped and that I
> have my RequestVar...
>
> I would like to form a closure on it.. an keep it for the post request
> so that it gets to ProcesssEntry and I do just :
>
> inInvoice.client (client)
> inInvoice.save
>
> As so no ids are involved...
>
> I would need to make a new RequestVar for the post submit with a copy
> of the input RequestVar I got in the AddInvoice from the ViewClient
> snippet
>
> But a SessionVar is out it's way overkill and a statefull snippet....
> might be an idea ... would the RequestVar persist in the statefull
> snippet?
>
> Also I'm having trouble understanding how that scoping is done for the
> RequestVar if anyone could shed some light on it... like why a closure
> won't "ref" it... (I'm new to scala)
>
> Thanks
>
> 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].
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to