[Lift] Re: JS event source in a server side handler

2009-12-10 Thread ced
I encountered the same problem and the only solution I found is the same as your's. But that doesn't seem to be the Lift way ;) Anyone knows? -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com.

[Lift] Hook into snippet creation

2010-01-17 Thread ced
Hi all, is there a way to hook into the creation of snippets? I'd like to gain control over their creation. I tried to find something in LiftRules but couldn't find anything that might be suitable for this purpose. But maybe I missed something. Any hints? Cheers, Chris -- You received this

[Lift] Re: Hook into snippet creation

2010-01-17 Thread ced
I thought about using a DI framework with Lift, having it manage a snippet's dependencies. On 17 Jan., 21:28, Marius marius.dan...@gmail.com wrote: Why do you need this? Br's, Marius On Jan 17, 10:24 pm, ced docpom...@googlemail.com wrote: Hi all, is there a way to hook

[Lift] Replace HTML element after AJAX call

2010-01-18 Thread ced
Hello, I'm wondering if there is a way to replace an HTML element after an AJAX call? I've found the SetHtml JsCmd, but this one replaces the content. But I'd like to replace the element itself. Any idea anyone? -- You received this message because you are subscribed to the Google Groups Lift

[Lift] Re: Replace HTML element after AJAX call

2010-01-18 Thread ced
using div as containers for replacement best regards On 18 Jan., 17:41, ced docpom...@googlemail.com wrote: Hello, I'm wondering if there is a way to replace an HTML element after an AJAX call? I've found the SetHtml JsCmd, but this one replaces the content. But I'd like

[Lift] Re: Ajax text onKeyPress

2010-01-18 Thread ced
You may try this: def ajaxLiveText(value: String, func: String = JsCmd, attrs: (String, String)*): Elem = { S.fmapFunc(S.SFuncHolder(func)) {funcName = (attrs.foldLeft(input type=text value={value}/)(_ % _)) % (onkeyup - makeAjaxCall(JsRaw(' + funcName + ='

[Lift] Re: Replace HTML element after AJAX call

2010-01-18 Thread ced
Found it in the repository. Thanks! On 18 Jan., 18:46, greekscala hellectro...@gmail.com wrote: Hello, the Replace JsCmd is not present in 1.0. workaround wrap it with an div. best regards On 18 Jan., 18:39, ced docpom...@googlemail.com wrote: Sorry, but I can't find it. Which

[Lift] Re: Hook into snippet creation

2010-01-19 Thread ced
Do you perhaps have an example function at hand? On 19 Jan., 06:12, David Pollak feeder.of.the.be...@gmail.com wrote: On Sun, Jan 17, 2010 at 12:24 PM, ced docpom...@googlemail.com wrote: Hi all, is there a way to hook into the creation of snippets? I'd like to gain control over

[Lift] Embedding comet actor in ModalDialog

2010-01-20 Thread ced
Hi all, I'm trying to create some sort of progress notification for a long lasting request. The idea is to answer an ajax request with a JqJsCmds.ModalDialog which embeds a comet actor like so: ajaxButton(Start process, () = ModalDialog(divdivProgress/ divlift:comet type=Progress//div))

[Lift] Re: Embedding comet actor in ModalDialog

2010-01-20 Thread ced
messages to client by sending from the ajax functions messages to the comet actor. Is that your use-case ? so see async intems coming from server only when the dialog is opened? Br's, Marius On Jan 20, 11:00 pm, ced docpom...@googlemail.com wrote: Hi all, I'm trying to create some

[Lift] Communication between snippet and comet actor via RequestVar

2010-01-29 Thread ced
Hi all, I've got the following scenario: A comet actor renders a link like this: SHtml.link(myURL, handleClick, Text(linkText), target - new_window) The handleClick function then stores some information in a RequestVar. Embedded into the page referenced by myURL, is a snippet that accesses the

[Lift] Re: Communication between snippet and comet actor via RequestVar

2010-01-29 Thread ced
.  The function generated during the execution of a CometActor is run in the context of the CometActor. This is an interesting and novel use case... Let me think about it for a little while. On Fri, Jan 29, 2010 at 12:31 PM, ced docpom...@googlemail.com wrote: Hi all, I've got the following

[Lift] Re: Communication between snippet and comet actor via RequestVar

2010-01-29 Thread ced
David, thanks for taking your time to give such an in-depth explanation. That gave me/all some valuable insights. - Chris On 30 Jan., 00:24, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jan 29, 2010 at 12:56 PM, ced docpom...@googlemail.com wrote: David, thanks

[Lift] addClass / removeClass attribute helper

2010-01-30 Thread ced
Sometimes I need to manipulate the class attribute of html elements, adding or removing classes. As I couldn't find any helpers to perform this task I wrote them myself. Maybe someone finds them useful. Cheers, Chris import scala.xml._ /** Add a value to the class attribute, removing

[Lift] JSON forms and multiple submit buttons

2010-01-31 Thread ced
I've implemented a JSON form similar to the one described in the Lift book. I need two submit buttons, each triggering a different action. So how to distinguish the submits? Unfortunately, the submit buttons themselves are not taken into account for the transferred JSON so that something like

[Lift] Snippet attribute pass through

2010-02-01 Thread ced
I want to set a node attribute in the template markup exactly like it is done in example 7.13 from the Lift Book. I'll paste it here: // the markup lift:Ledger.balance ledger:time ledger:id=myId/ /lift:Ledger.balance // The snippet class class Ledger { def balance (content : NodeSeq ) : NodeSeq

[Lift] JsonHandler capturing state from enclosing snippet

2010-02-10 Thread ced
Hi everybody, I'm having a JsonHandler object inside a snippet and I want to access some vals from to enclosing snippet. But unfortunately this doesn't work, because it seems that there is just one single instance per session and class name maintained by Lift. Having a fresh handler per snippet

[Lift] Re: JsonHandler capturing state from enclosing snippet

2010-02-11 Thread ced
): JsCmd = { // access value } } } - Chris On 11 Feb., 00:50, David Pollak feeder.of.the.be...@gmail.com wrote: On Wed, Feb 10, 2010 at 2:47 PM, ced docpom...@googlemail.com wrote: Hi everybody, I'm having a JsonHandler object inside a snippet and I want to access some vals from

[Lift] Re: Transactions with Mapper

2010-03-02 Thread ced
Ah great! Thanks! - Chris On Mar 2, 2:37 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: ced docpom...@googlemail.com writes: When I use Mapper outside a request, say in an actor, how do I wrap it in a transaction? I know that I do a S.addAround(DB.buildLoanWrapper) to have transactions

[Lift] Re: Is CometActor the right tool for this job?

2010-03-02 Thread ced
I have a similar use case and from my experience using a CometActor is just great for this. 1) I assume each page get their own instance of the actor so they can hold their own data. Is this correct? Yes. 2) When is a CometActor shutdown? Sometime after the user navigates away from page?

[Lift] Re: Transactions with Mapper

2010-03-02 Thread ced
Another question: Is it possible to nest DB.use? I'd like to have the same behavior as with the @Transaction annotation from Spring. On 2 Mrz., 14:55, ced docpom...@googlemail.com wrote: Ah great! Thanks! - Chris On Mar 2, 2:37 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: ced docpom

[Lift] Re: Transactions with Mapper

2010-03-02 Thread ced
Great! The default behavior with Spring's @Transactional annotation is the propagation of an existing transaction or, if none is active, the creation. So behavior is equal. On 2 Mrz., 17:09, David Pollak feeder.of.the.be...@gmail.com wrote: On Tue, Mar 2, 2010 at 7:03 AM, ced docpom

[Lift] Re: Is CometActor the right tool for this job?

2010-03-03 Thread ced
1) I assume each page get their own instance of the actor so they can hold their own data. Is this correct? Yes. No, it's not correct.  There's one CometActor of a given type/name per session. Sorry for this. I just hat the relation one page - user (== session) in mind... -- You

[Lift] Re: JSON help...

2010-03-04 Thread ced
The approach I take to decompose JSON data delivered by JsonHandler (which is in the form of Map[String, _]) is to use extractors that act as converters, so that the code looks pretty much like in Joni's first posting. for{param - json (messageId, IsInt(messageId)) - param} yield ... object

[Lift] Re: Newbie Q: how to append html on ajaxForm submission

2010-03-05 Thread ced
There is an AppendHtml object in net.liftweb.http.js.jquery.JqJsCmds that generates a JsCmd. AppendHtml(my-element-id, spanappend me/span) Is this what you're looking for? On 5 Mrz., 09:57, Lukasz Kuczera kuk...@gmail.com wrote: Hi Folks, I've hard time to figure out how to append html snippet

[Lift] Re: superficial first impressions from a rails junkie

2010-03-06 Thread ced
This thread is another nice example of the kindly atmosphere within the Lift community! It's already late so I don't want to join the discussion in detail ;) The only thing I'd like to add to the documentation talk is that I'd really appreciate to have an up-to-date aggregated scaladoc of all