Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-09 Thread David Pollak
On Mon, Dec 7, 2009 at 9:14 PM, Xuefeng Wu ben...@gmail.com wrote: Hi David Ross, Thank you for your help, I understand RequestVar now, which muse be used in the same request. My case is that I have a tree and a separate button. When use click the tree node, the separate button should

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-09 Thread Xuefeng Wu
doCompetenceB render a button which user click and will pop a dialog for create a competence. *The competence have category property, I want this pop dialog know the category which user already selected from the category tree. * On Thu, Dec 10, 2009 at 7:19 AM, David Pollak

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-09 Thread David Pollak
On Wed, Dec 9, 2009 at 5:35 PM, Xuefeng Wu ben...@gmail.com wrote: doCompetenceB render a button which user click and will pop a dialog for create a competence. *The competence have category property, I want this pop dialog know the category which user already selected from the category

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-09 Thread Xuefeng Wu
That's great! Thank you for your help. On Thu, Dec 10, 2009 at 11:06 AM, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Dec 9, 2009 at 5:35 PM, Xuefeng Wu ben...@gmail.com wrote: doCompetenceB render a button which user click and will pop a dialog for create a competence. *The

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Xuefeng Wu
Hi , When I use RequestVar get the message: RequestVar ... was set but not read My code like this: object MyMgr { ... Loc.Snippet(myFoo,myFoo) ... object myId extends RequestVar[Long](0) def myFoo(xhtml: NodeSeq): NodeSeq = { def selectNode = {

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Ross Mellgren
I think that message is just informative, letting you know that you don't seem to be using the request var fully (perhaps due to typo, or code refactoring that made it unused, or something.) I think it'll go away if you access the variable somewhere using myId.is. -Ross On Dec 7, 2009, at

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Xuefeng Wu
I use myId.is but get nothing. I don't know what I could do with the information. On Tue, Dec 8, 2009 at 10:19 AM, Ross Mellgren dri...@gmail.com wrote: I think that message is just informative, letting you know that you don't seem to be using the request var fully (perhaps due to typo, or

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Ross Mellgren
Well if you logically expected it to be read but it wasn't, it might indicate a bug to you or help in diagnosis. I'm not sure I understand your reply fully -- when you added myId.is did the log message go away? If not, could you post your code? -Ross On Dec 7, 2009, at 9:39 PM, Xuefeng Wu

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Xuefeng Wu
My code : object CompetenceMgr { Menu(Loc(Competence, List(competence, index), S.?(Competence), ifIsLoggedIn, ... Loc.Snippet(buildCompetenceDicRows, buildCompetenceDicRows), Loc.Snippet(addCompetenceB, addCompetenceB), private object

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Ross Mellgren
I'm sorry, I'm having trouble following your code, I think too much of the surrounding code and templates is missing for me to reason about why you would have a problem. I set up a quick example app, so maybe the code from that will help you. It is here:

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Xuefeng Wu
Hi Ross, Yes it's not in the same request. My case is: When user select a tree node, I want to store this nodeId and If user click a button to create a child node, I want to get the selected node. I use ModalDialog when user click the button to create now node. On Tue, Dec 8, 2009 at 11:50 AM,

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Xuefeng Wu
My current solution is that when user select a tree node, I replace the add button dependence on the node. 2009/12/8 Xuefeng Wu ben...@gmail.com Hi Ross, Yes it's not in the same request. My case is: When user select a tree node, I want to store this nodeId and If user click a button to

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread David Pollak
On Mon, Dec 7, 2009 at 8:37 PM, Xuefeng Wu ben...@gmail.com wrote: Hi Ross, Yes it's not in the same request. It's not the same request. The code: a(() = { *//here I try to get the categoryId if it selected.* val catId: Long = _categoryId.is

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread David Pollak
On Mon, Dec 7, 2009 at 8:46 PM, Xuefeng Wu ben...@gmail.com wrote: My current solution is that when user select a tree node, I replace the add button dependence on the node. If you can create a very simple example of what you're trying to do, we can help you debug the actual, runnable code.

Re: [Lift] Sharing data between snippet functions during a single HTTP request

2009-12-07 Thread Xuefeng Wu
Hi David Ross, Thank you for your help, I understand RequestVar now, which muse be used in the same request. My case is that I have a tree and a separate button. When use click the tree node, the separate button should know which node is selected. Right now I replace the separate button when

[Lift] Sharing data between snippet functions during a single HTTP request

2009-11-20 Thread Alex Black
I've got a template page, say foobar.html, that makes a number of calls to functions in a snippet, e.g. mysnippet.foo1, mysnippet.foo2, mysnippet.foo3. I'd like to do some initial work in foo1, e.g. retrieve some data and do some work on it, then in foo2 and foo3 display parts of that data.