it would be way less overhead, if there would be a reference back from
the inputText to the outputLabel that is actually stored with the
inputText and not just logically defined by the 'for' attribute of
label. If a reference to the outputLabel would be stored in a collection
with the inputText by setting the 'for'-attribute on outputLabel it
could be just taken from there and wouln't require runtime-walk of the
component-tree to be retrieved.
Such a mechanism to define (and resolve) inter-component-relationships
more efficiently would be helpfull in many other cases where components
logically belonging together are not in a parent-child (or parent-facet)
relationship. A good (and recently discussed) example is form-based
validation by a custom-validator where the validator would have to get
access to (logically, but not nessesary hirarchically) related
components as well.
- Norbert
-----Original Message-----
Date: Mon, 14 Sep 2009 21:17:22 +0200
Subject: Re: DRY and form with JSF 2
From: Alaxander Smirnov <asmirnov(a)exadel.com>
To: jsr-314-open(a)jcp.org
I agree with label parameter for validation message, because
for some languages the best place of label would be not in front of
message ( that is true for Russian messages, for example ).
But lookup for label component seems overhaul, it could get us
impact on performance due to additional lookups in the components tree
( implementation should walk though whole tree because input component
has no direct reference for label ).
On 09/14/2009 10:08 AM, Dan Allen wrote: Any votes? Once some votes
come in, we can convert this into a feature request in the Issue
Tracker. Counter proposals are also welcome.
-Dan
On Mon, Sep 14, 2009 at 1:03 PM, wrote:
i think that could be a good enhancement.
Le 14 sept. 2009 à 18:39, Dan Allen a écrit :
I've run into the same problem every time
I get to polishing a JSF application. My thought is that there should
be a new positional replacement value in message templates that allows
you to plug in the value of the correlated output label. (If there are
multiple, the first would be selected).
In general, the position replacements are:
0 = invalid value
1 = example value (sometimes this applicable, in which case the
positional parameters shift)
2 = client id
We could add
3 = label value
It's debatable whether the HTML should be stripped from the value.
javax.faces.converter.DateTimeConverter.DATE={3}: ''{0}'' could not
be understood as a date. Example: {1}
-Dan
On Sat, Sep 12, 2009 at 9:24 AM, Damien Gouyette wrote:
Hello,
I have a lot of forms to do and i don't understand
a point
if i don't set label on inputText, i have an error
message like :
_formNew:birthDate: 'a' could not be understood as
a date. Example: 12/09/2009 instead of _
CLIENT\'S BIRTHDATE : 'a' could not be
understood as a date. Example: 12/09/2009
Can you reuse outputLabel value if exists ?
Just for information, this message is the french
error message when i set a dateConverter on my inputText. (little bug)
Damien GOUYETTE
--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597
http://mojavelinux.com [4]
http://mojavelinux.com/seaminaction [5]
http://www.google.com/profiles/dan.j.allen [6]
--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597
http://mojavelinux.com [7]
http://mojavelinux.com/seaminaction [8]
http://in.relation.to/Bloggers/Dan [9]
Links:
------
[1] mailto:damien.gouyette@gmail.com
[2] mailto:dan.j.allen@gmail.com
[3] mailto:damien.gouyette@gmail.com
[4]
http://mojavelinux.com
[5]
http://mojavelinux.com/seaminaction
[6]
http://www.google.com/profiles/dan.j.allen
[7]
http://mojavelinux.com
[8]
http://mojavelinux.com/seaminaction
[9]
http://in.relation.to/Bloggers/Dan