Uploaded image for project: '[Read Only] - Hippo Plugins'
  1. [Read Only] - Hippo Plugins
  2. HIPPLUG-226

Easy Forms: return id in the html output

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      Bram van Essen:

      While implementing a Easy Forms template that takes the accessibility guidelines into account a bit more,
      I ran into a problem that the radiobuttons and checkboxes don't return an id attribute in the call to getHtml().
      The following code is used in the getHtml():

      @Override
      public String getHtml()

      { final StringBuilder builder = new StringBuilder(); return builder.append("<input type=\"checkbox\"") .append(generateAttribute("name", getName(), false)) .append(generateAttribute("value", getValue(), false)) .append(getCssMeta()) .append(generateAttribute("checked", isChecked() ? "checked" : "", false)) .append(" />").toString(); }

      Setting the id on a specific checkbox works, but due to the code above it never gets returned.
      I know it should be possible to override this, but couldn't get that to work on a short notice.

      I had to change the jsp (demo) template to get the id attribute in the checkbox:

      • Drop the ${box.html}.,
      • Change it to the complete checkbox code.

      The request for a future Easy Forms:

      @Override
      public String getHtml()

      { final StringBuilder builder = new StringBuilder(); return builder.append("<input type=\"checkbox\"") .append(generateAttribute("name", getName(), false)) .append(generateAttribute("value", getValue(), false)) .append(generateAttribute("id", getId(), false)) .append(getCssMeta()) .append(generateAttribute("checked", isChecked() ? "checked" : "", false)) .append(" />").toString(); }

      Attachments

        Activity

          People

            Unassigned Unassigned
            mmilicevic Marijan Milicevic
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: