[ 
https://issues.apache.org/jira/browse/TAPESTRY-975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Raible reopened TAPESTRY-975:
----------------------------------


In 4.1.3, when I have a label:

<label class="desc" jwcid="@FieldLabel" 
field="component:usernameField">Username</label>

The following doesn't work to produce <label class="desc error">

@Override
    public void writeLabelAttributes(IMarkupWriter writer, IRequestCycle cycle, 
IFormComponent component) {
        if (isInError()) {
            writer.appendAttribute("class", "error");
        }
    }

Nor does writer.attribute:

@Override
    public void writeLabelAttributes(IMarkupWriter writer, IRequestCycle cycle, 
IFormComponent component) {
        if (isInError()) {
            writer.attribute("class", "error");
        }
    }

> Overriding ValidationDelegate and adding a "class" attribute results in 
> duplicate attributes
> --------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-975
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-975
>             Project: Tapestry
>          Issue Type: New Feature
>          Components: Framework
>    Affects Versions: 4.0.2
>            Reporter: Matt Raible
>            Assignee: Jesse Kuhnert
>             Fix For: 4.1.1
>
>
> I have the following in my custom ValidationDelegate:
>     public void writeAttributes(IMarkupWriter writer, IRequestCycle cycle,
>                                 IFormComponent component, IValidator 
> validator) {
>         if (isInError()) {
>             String cssClass = ((component.getBinding("class") != null) ?
>                                 
> component.getBinding("class").getObject().toString() : "");
>             writer.attribute("class", cssClass + " error");
>         }
>     }
> However, rather than just writing a single "class" attribute, it writes two:
> class="text large error" class="text large" 
> Ideally, only one "class" attribute gets written.  Maybe IMarkupWriter nees 
> an appendAttribute() method, or it just needs to be smart enough to detect 
> duplicates?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to