I'd like to propose removing the pop-up validation bubbles as part of
JavaScript restructuring in 5.3.
Rationale:
- They can be clumsy, especially near the edges of the page
- There's a lot of bookkeeping involved in tracking fields with focus,
to trigger the right fade in/fade out animations
- They are really very difficult to override and customize
- Most people hate them and find them garish
- On a form submission, they can really obscure the page (for a moment)
I'd suggest, instead, something a little more basic.
Fields would be decorated with additional spans (this would be a
function of the ValidationDecorator I think, but possible all done on
the client side).
<span class="t-field-container">
<input type="text" .../>
<span class="t-field-icon"/>
<div class="t-field-message"/>
</span>
When a client-side validation error occurs, the div.t-field-message
could be modified in place, adding the error message and perhaps
making it visible. The details are in flux in my mind, but I kind of
see adding a CSS class name to span.t-field-container that would
trigger rules about how to draw it. I.e., if t-error, then draw in
red, and so forth. span.t-field-icon is used to display an error
icon, or perhaps an ajax "throbber". In either case, this could be
done with modern CSS, using display:inline-block and background
properties.
The end result would be that the message would appear underneath the
field. Further, clients could easily customize the L&F with just CSS
rules.
A bunch of variations occur to me; perhaps the ValidationDecorator
just puts the span.t-field-container in place, and the client-side JS
provides the rest, to optimize the amount of content sent over HTTP.
Perhaps the ValidationDecorator looks for meta-data to decide whether
t-field-message appears above or below. With modern CSS, there's less
of a need to add additional levels of <divs> to create rounded corners
and nibs and the like.
I also haven't fully thought through what needs to happen with the
Label; it would be nice to wrap the Label with a similar span, and
perhaps put error icons on the label as well as the field.
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]