Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-975

Overriding ValidationDelegate and adding a "class" attribute results in duplicate attributes

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.2
    • Fix Version/s: 4.1.5
    • Component/s: Framework
    • Labels:
      None

      Description

      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?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jkuhnert Jesse Kuhnert
                Reporter:
                mraible Matt Raible
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: