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

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

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.0.2
    • 4.1.5
    • Framework
    • 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

        1. ValidationDelegate.java
          3 kB
          Matt Raible

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: