cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: WoodyTransformer: radio buttons
Date Wed, 12 Nov 2003 10:51:22 GMT
On Tue, 2003-11-11 at 15:15, Vadim Gritsenko wrote:
> Hey guys,
> 
> Has anybody have any suggestions on how to make @required=true, 
> <wi:styling list-type="radio"/>, widget make less ugly? Currently it 
> looks like:
>    (   ) Label for the first radio button
>    ( o ) Second
>    (   ) Third *
> Where * indicates that the widget is required, but is higly misleading 
> because it is attached to the third radio button.

For this particular case it can maybe be solved by putting these in a
two-column table, with the radio buttons in the first column and the *
in the second column.

> 
> I came up with several workarounds:
> 1) Change how woody transformer transformrms wt:widget-labels.
> Currently, validation error messages and @required attribute are present 
> only on wi:field (and similar elements). And wt:widget-label disappears 
> completely, replaced by the content of the label. Instead, it can 
> replace wt:widget-label with wi:widget-label, which has validation 
> messages and required attribute. This way, you have more flexibility in 
> styling the form, including placing of error messages.

Yes, but then you'd have to place the required indication and validation
errors with together with the label. What if I want to put them
somewhere else completely?

In general I think there are 4 items that one may like to place
separately: the label, the widget itself, the required indication and
the validation errors.

I think it would then be better to introduce new tags like wt:required
and wt:validation-errors so that each of these can be retrieved
separately.

Whether the stylesheet needs to put the required indication and
validation errors next to the widget could be controlled by a stylesheet
parameter, with as default behaviour the situation like it is now.

> 
> 2) Do not use woody-field-styling.xsl at all; roll your own... wi:field 
> has all the necessary data.
> 
> 3) Make woody-field-styling.xsl more flexible: divide field styling into 
> several steps (using mode="" attribute on templates)
> 
> 4) Ask list for other suggestions :)
> 
> 
> BTW, is anybody against replacing <xsl:template 
> name="woody-field-common"/> with <xsl:template match="wi:*" 
> mode="common"> ? It's not possible to override in the including 
> stylesheet named templates, but you can override match="" templates.

+1 for making them overridable (and thus also for what Joerg was
proposing)

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Mime
View raw message