Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-09 Thread Philippe Monnaie
You could try: object Config{ def error(xs) = { S.error(xs) fadeOutErrors(5 seconds, 1 second) } } and call Config.error(xs) instead of S.error(xs) or something similar. I'm sure someone can come up with a more elegant solution than this. Just the first thing that popped into my

Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-09 Thread Xuefeng Wu
It's not make sense for my project. I separate business transaction from UI logic. When create or update business model will occur notice or error, and then do something for UI by the business transaction for example: business: def MyBusinessTransaction(v: String) : Option[MyModel] = { val

Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-09 Thread Xuefeng Wu
Hello Marius, I have an other question about S.error. When I use: S.error(can not delete this department.) I get: try{jQuery(#lift__noticesContainer__).each(function(i) {this.innerHTML = divErrorullican not delete./li/ul /div;});} catch (e) {} What I want this

Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-09 Thread David Pollak
I think this particular use case is very interesting. There should be a flexible (LiftRules or in the Msgs snippet) mechanism for making this behavior flexible... doing it for all users, doing it on a user-by-user basis. Please open a ticket at http://github.com/dpp/liftweb/issues referencing

[Lift] Re: highlight the lift notices in some seconds

2009-12-09 Thread Marius
On Dec 9, 3:41 pm, Xuefeng Wu ben...@gmail.com wrote: Hello Marius, I have an other question about S.error. When I use: S.error(can not delete this department.) I get: try{jQuery(#lift__noticesContainer__).each(function(i) {this.innerHTML = divErrorullican not delete./li/ul /div;});}

[Lift] Re: highlight the lift notices in some seconds

2009-12-08 Thread Marius
You don't need to configure anything in boot. Assume this is an Ajax function: def howdy: JsCmd = { S.error(howdy error) fadeOutErrors(5 seconds, 1 second) } ... in your snippet you can say: SHtml.a(Text(Click me)(howdy _) If you want to fade out errors in a page and not via

[Lift] Re: highlight the lift notices in some seconds

2009-12-08 Thread Marius
Are you using field validate into an Ajax context or not? If not using something like: def howdy = { S.error(howdy error) spanHello there/span ++ head{Script(OnLoad(fadeOutErrors(5 seconds, 1 second)))} /head } from your snippet should be ok. If you are using validate from an

Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-08 Thread Xuefeng Wu
Yes, I do something like // do the DB stuff vmyMapper.validate match { case Nil = case xs = S.error(xs) } But I should always add fadeOutErrors(5 seconds, 1 second)? I want lift highlight every error/notice information. On Tue, Dec 8, 2009 at 5:56 PM, Marius marius.dan...@gmail.com

[Lift] Re: highlight the lift notices in some seconds

2009-12-08 Thread Marius
Yes you need to send down fadeOut... call def myFunc: JsCmd = { // do some DB stuff vmyMapper.validate match { case Nil = Noop case xs = S.error(xs); fadeOutErrors(5 seconds, 1 second) } } On Dec 8, 3:01 pm, Xuefeng Wu ben...@gmail.com wrote: Yes, I do something like  // do the DB

Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-08 Thread Xuefeng Wu
I think It's better I could configure it, but not code every where. On Tue, Dec 8, 2009 at 9:23 PM, Marius marius.dan...@gmail.com wrote: Yes you need to send down fadeOut... call def myFunc: JsCmd = { // do some DB stuff vmyMapper.validate match { case Nil = Noop case xs =

[Lift] Re: highlight the lift notices in some seconds

2009-12-07 Thread Marius
Please see this: http://groups.google.com/group/liftweb/browse_thread/thread/972562da2c40ce88/ea30455fc11d4e1f?hl=enlnk=gstq=notice+fade#ea30455fc11d4e1f If you are using Ajax, notices could easily fade out. Br's, Marius On Dec 8, 8:02 am, Xuefeng Wu ben...@gmail.com wrote: Hi,     I want to

Re: [Lift] Re: highlight the lift notices in some seconds

2009-12-07 Thread Xuefeng Wu
Yes, it's my wanted. How could I configure it at boot? On Tue, Dec 8, 2009 at 3:44 PM, Marius marius.dan...@gmail.com wrote: Please see this: http://groups.google.com/group/liftweb/browse_thread/thread/972562da2c40ce88/ea30455fc11d4e1f?hl=enlnk=gstq=notice+fade#ea30455fc11d4e1f If you are