On Thu, Nov 12, 2009 at 3:44 AM, Eduardo Costa <[email protected]>wrote:
> > I published this tip on my blog (http://extremejava.tpk.com.br/ > 2009/11/12/customizing-liftwebs-errorwarningnotice-messages/<http://extremejava.tpk.com.br/%0A2009/11/12/customizing-liftwebs-errorwarningnotice-messages/>), > but, > I'll put here as a quick reference for other liftweb users: just > create a snippet named "msgs". It can be like this one: > Thanks! > > package mypkg.snippet > class Msgs { > def msgs(cls : String, ms : List[NodeSeq]) = ms match { > case Nil => Nil > case x => <div class={ cls }>{ ms.flatMap(m => <p>{ m }</p>) }</ > ul> > } > def render(xml : NodeSeq) : NodeSeq = > <div id={ LiftRules.noticesContainerId }> > { msgs("msgError", noIdMessages(errors)) } > { msgs("msgWarning", noIdMessages(warnings)) } > { msgs("msgNotice", noIdMessages(notices)) } > </div> > } > > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://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 -~----------~----~----~----~------~----~------~--~---
