Uploaded image for project: 'Click'
  1. Click
  2. CLK-33

HTML escaped in actionlink label

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • core
    • None

    Description

      I am playing with Table and had a Decorator set up to display three clickable images (read, edit and delete). Each of these ActionLinks was represented with a label that held an image.

      E.g.
      viewLink.setListener(this, "onViewClick");
      viewLink.setLabel("<img src=\"/dca/images/buttons/lightbulb.gif\">");
      viewLink.setAttribute("title", "View access control details");

      This worked until I moved to Click 0.15, which uses HTMLStringBuffer to render the link in the Decorator.

      Line 574 in ActionLink has 'buffer.appendEscaped(getLabel());'

      This is escaping the brackets around the <img src=...> labels that I am assigning. Eg I get <img src=...

      Maybe a solution is to set a boolean on the ActionLink/Control to indicate whether to allow HTML in the label?

      Eg

      viewLink.shouldEscapeHTML(false)?

      And in ActionLink (and elsewhere in toString methods in Control subclasse?)

      line 574:
      if (shouldEscapeHTML) buffer.appendEscaped(getLabel())
      else buffer.append(getLabel());

      Attachments

        Activity

          People

            medgar Malcolm Edgar
            ghopson Geoff Hopson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: