How to create "success" message ?

78 views
Skip to first unread message

Nikola

unread,
Oct 16, 2013, 6:33:32 AM10/16/13
to lif...@googlegroups.com
Hi,
the framework has 
 
S.notice S.error S.warning
messages.

If I would like to have an extra success message what will be the best way to create this S.success message ?
extend S class ? Can someone give me a hint there to hack in the code (I am not that good in Scala) ?

Regards,
Nikola

zaza

unread,
Oct 16, 2013, 6:57:19 AM10/16/13
to lif...@googlegroups.com
Hi Nikola,

a solution is to extend S class as you say.

class myMessages extends  S{
def success (n: String) {notice(Text(n))}

}


I hope it helps you.

A.

Antonio Salazar Cardozo

unread,
Oct 16, 2013, 1:21:50 PM10/16/13
to lif...@googlegroups.com
What is your distinction between notice and success? I've generally used notice and success interchangeably in the past.
Thanks,
Antonio

Nikolaj Majorov

unread,
Oct 18, 2013, 6:57:37 AM10/18/13
to lif...@googlegroups.com
Hi,
every HTML framework has the different  types of alerts

for example bootstap has
options, errors, info, success.



success gives nice green box in the case of successfully performed action and not just information 
blue box , so it makes really different user experience. 
with lift  I'm in the moment limited with notice message only. I  would like to have separate "success" type of message.

Regards,
Nikola


2013/10/16 Antonio Salazar Cardozo <savedf...@gmail.com>

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
---
You received this message because you are subscribed to a topic in the Google Groups "Lift" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/liftweb/D0l0KnU24JM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Antonio Salazar Cardozo

unread,
Oct 18, 2013, 1:41:26 PM10/18/13
to lif...@googlegroups.com
Yes, well, each framework seems to choose its own subset.

At the moment there's no clear way to extend the actual types used for notices. One option you have is to render the notices yourself, and use a prefix on the content of the notice to indicate if it's success or failure that your renderer can then use to do the appropriate thing. Another option is that S.notice can take a Node, so you can actually put HTML directly into it. Those are the two that come to mind off the top of my head.
Thanks,
Antonio

Julio

unread,
Oct 18, 2013, 3:57:18 PM10/18/13
to lif...@googlegroups.com
an "extra success message?" there's lift-extras (https://github.com/eltimn/lift-extras). it has lots of bootstrap specific features including LiftNotice.success

Peter Petersson

unread,
Oct 19, 2013, 4:03:40 AM10/19/13
to lif...@googlegroups.com
On 10/18/2013 12:57 PM, Nikolaj Majorov wrote:
Hi,
every HTML framework has the different  types of alerts

for example bootstap has
options, errors, info, success.


Bootstrap 3 alerts [1] are the following, success, info, warning, danger (former errors)

[1] http://getbootstrap.com/components/#alerts

best regards Peter Petersson
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.

Nikolaj Majorov

unread,
Oct 20, 2013, 11:10:05 AM10/20/13
to lif...@googlegroups.com
It looks like the lift-extras is the way to go. 
Thank you Julio !



On 18.10.2013, at 21:57, Julio <j.ca...@gmail.com> wrote:

an "extra success message?" there's lift-extras (https://github.com/eltimn/lift-extras). it has lots of bootstrap specific features including LiftNotice.success

Reply all
Reply to author
Forward
0 new messages