[Lift] Another wiki article ...

3 views
Skip to first unread message

Marius

unread,
Apr 28, 2010, 4:00:56 PM4/28/10
to Lift
Please see here: https://www.assembla.com/wiki/show/a-L5GeVBGr3RE_eJe5aVNr/Lift_notices_and_auto_fadeout


Br's,
Marius

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

Home

unread,
Apr 28, 2010, 4:20:40 PM4/28/10
to lif...@googlegroups.com
Cool beans!

Connected by MOTOBLUR™ on T-Mobile

-----Original message-----

Anders Johansen

unread,
Apr 29, 2010, 10:17:48 AM4/29/10
to Lift

Is there any way to associate notices with individual form elements?
For example, if they enter an invalid social security number, it would
be nice if the error would appear next to the field rather than at one
specific spot.

Cornelius Brümmer

unread,
Apr 29, 2010, 11:04:02 AM4/29/10
to lif...@googlegroups.com
In your templates you can use the "local" messages, described in the
wiki-page:

Somewhere in a template, a table-row for username-input:
<tr>
<td>Username:</td>
<td><u:inputsomthing /></td>
<td><lift:msg id="username_msgs"/></td>
</tr>

... in your Snippets you can address this specific lift-Message-"field"
by: S.notice("username_msgs", "Wow nice username") ... or if you want to
get angry: S.error("username_msgs", "Username completely inacceptable")

... and you can have an abritrary number of lift:msg-items.

Sidenote:
If you use Blueprint, there are some predefined CSS-Classes for:

Quote from screen.css (or forms.css):
.error {... }
.notice {... }
.success {... }

to get them used automagically change the <lift.msg />-thing above to:

<lift:msg id="username_msg" noticeClass="notice" errorClass="error" />

and your notes will be funky and colorfull.

Cornelius

Anders Johansen

unread,
Apr 29, 2010, 12:58:52 PM4/29/10
to Lift

Thank you for the information!

On Apr 29, 10:04 am, Cornelius Brümmer <d...@corcor.de> wrote:
> In your templates you can use the "local" messages, described in the
> wiki-page:
>
> ...
Reply all
Reply to author
Forward
0 new messages