Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-773

Select component should have parameter to allow option labels to be rendered w/o HTML entity escaping

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.3.6, 5.2.5, 5.1.0.5
    • 5.4
    • tapestry-core
    • None

    Description

      All ampersands that are returned from getLabel() in an OptionModel get encoded to &. This makes it impossible to use any html entities (—   etc) within option labels in selects. This is not that uncommon and should definitely be supported by Tapestry out of the box.

      It can be fixed by changing line 60 of org.apache.tapestry5.internal.util.SelectModelRender from

      writer.write(optionModel.getLabel());

      to

      writer.writeRaw(optionModel.getLabel());

      This would mean that ampersands will need to be encoded for option labels, but this is at least possible for a developer to do. Currently it's not possible to use entities without using a custom select component, you can't even extend the T5 Select class and override the Render nested class.

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            andyb Andy Blower
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: