Richard,
Although what you are describing might be technically correct, the fact of
the matter is difficult for application developers using Woodstock to align
components in the traditional way of having all labels in one column of a
table (usually a panel grid in JSF applications), and the components
themselves in an adjacent column when using the "label" attribute of
Woodstock components, since when using this attribute the label and
component cannot be placed on separate columns.
The solution for this is not to use the label attribute, but use a separate
label component. This works as expected for alignment but it has the side
effect of generating user "unfriendly" error messages on validation since
the component ID's are shown in the error message instead of the label.
This situation feels like a "catch-22" for application developers, if we
want user friendly validation errors, we can't vertically align components
easily, if we want to easily align our components, we can't have user
friendly error messages.
In my comments for issue 1200 (
https://woodstock.dev.java.net/issues/show_bug.cgi?id=1200), I proposed a
solution to this problem, which is to have any components that output JSF
errors (such as <webuijsf:message> and <webuijsf:messageGroup>) pick up the
label text of any label components whose "for" attribute matches the id of
the component that generated the error, and display it in the error message
instead of the component ID.
An alternative solution would be to have the Woodstock components behave
more like the standard JSF components, and use the "label" attribute only
for error messages, and rely on a separate label component to display labels
on the page.
David
On Fri, Jun 6, 2008 at 9:40 AM, richard ratta <Richard.Ratta_at_sun.com> wrote:
>
>
> Stefan Bley wrote:
>
> Hi,
>>
>> JSF 1.2 introduces the attribute "label" to most of the input components,
>> e.g. <h:inputText>. That is to provide a useful component name that is
>> shown
>> in <h:message(s)> when validation errors occur.
>>
>> However, Woodstock itself provides a "label" attribute to shortcut the
>> labeling of input components. So how would you plan to be highly compliant
>> with the standard JSF components?
>>
> The "label" attribute you describe if it is defined on "inputText", is not
> part of the JSF
> component spec. It is part of the default JSP language binding or the JSF
> default component set.
>
> The Woodstock components are not a JSF implementation as per the spec,
> since we are not an
> implementation Woodstock does not have implement every part of the spec.
> Woodstock is a JSF component library that extends the JSF component model
> and runs on
> JSF 1.2 implementations. Woodstock components extend from UIInput,
> UICommand, UICompoent
> and not the default component implementations.
> I don't believe these classes define a "label" property.
>
> How can I use the "label" feature from JSF
>> 1.2 within Woodstock without having a label rendered?
>>
>>
> You couldn't even if we didn't have a label attribute. The JSF classes we
> extend
> from do not define a "label" attribute.
>
> -rick
>
> Regards, Stefan
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_woodstock.dev.java.net
> For additional commands, e-mail: dev-help_at_woodstock.dev.java.net
>
--
http://ensode.net - A Guide to Java, Linux and Other Technology Topics
http://java-ee-5-glassfish.packtpub.com/ - Java EE 5 Development Using
GlassFish Application Server
http://jasperreportsbook.packtpub.com - JasperReports For Java Developers