You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Danny Robinson <da...@gmail.com> on 2007/07/26 18:47:03 UTC

[Trinidad] Client-Side Validation - Updated tr:messages component

Guys,

Just a heads-up.  I committed a bunch of changes and some fixes for
client-side validation late yesterday.  They were:

tr:messages now participates in c/s validation and adds/removes an anchor +
summary text to the message list.  Server-side messages are left intact
until the next submit.  Component is also shown/hidden when messages are
added/removed.  Implementation uses TrMessageBox javascript class that wraps
rendered tr:messages component.

Added a javascript alert when an input fails c/s validation, but there's no
simple="true" and there's no tr:message or tr:messages.  Text of alert is
"Field Error [" + id + "] - "+ facesMessage.getDetail().  It is intended to
assist developers rather than for production, as it pops once each time this
scenario is encountered.

I've also added a new field to the client validation demo to prove it works
with selectOneRadio (ie. inputs that are really js arrays).

Please give it a test drive and let me know what you find.

Regards,

Danny

ps - Adam, you have TRINIDAD-96 (
Validators should be added incrementally) - I'm assuming we can change
inline validation to use onchange/onblur once you're done with this?

-- 
Chordiant Software Inc.
www.chordiant.com

Re: [Trinidad] Client-Side Validation - Updated tr:messages component

Posted by Adam Winer <aw...@gmail.com>.
On 7/26/07, Danny Robinson <da...@gmail.com> wrote:
> Guys,
>
> Just a heads-up.  I committed a bunch of changes and some fixes for
> client-side validation late yesterday.  They were:
>
> tr:messages now participates in c/s validation and adds/removes an anchor +
> summary text to the message list.  Server-side messages are left intact
> until the next submit.  Component is also shown/hidden when messages are
> added/removed.  Implementation uses TrMessageBox javascript class that wraps
> rendered tr:messages component.
>
> Added a javascript alert when an input fails c/s validation, but there's no
> simple="true" and there's no tr:message or tr:messages.  Text of alert is
> "Field Error [" + id + "] - "+ facesMessage.getDetail().  It is intended to
> assist developers rather than for production, as it pops once each time this
> scenario is encountered.
>
> I've also added a new field to the client validation demo to prove it works
> with selectOneRadio (ie. inputs that are really js arrays).
>
> Please give it a test drive and let me know what you find.

Cool stuff!  Looking forward to it.

> Regards,
>
> Danny
>
> ps - Adam, you have TRINIDAD-96 (
> Validators should be added incrementally) - I'm assuming we can change
> inline validation to use onchange/onblur once you're done with this?

The two tasks are independent of each other:  what TRINIDAD-96
will let us do is start really optimizing PPR.  Today, the validator info
gets added as a whole, so we have to walk the whole tree every
render.  If it got added incremently, we could skip (for example)
every naming container that has no children, omit leaf nodes that
aren't being renderers, etc., and hopefully get to a point where
(in 1.2) we could just invokeOnComponent() the target component.

-- Adam


>
> --
> Chordiant Software Inc.
> www.chordiant.com