Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5 M1
    • Fix Version/s: 1.5 M2
    • Component/s: None
    • Labels:
      None

      Description

      #1. Please add a chaining based HtmlStringBuffer utility class.
      I know that method chaining is pretty bad practice for many cases, and when available it's always totally misused (I revied myself allot of such code), but I think in the case of HtmlStringBuffer it would be an improvement and would make the rendering code (that is ugly indepenent of language due to HTML ) look a little bit nicer:
      Unchained:
      ----------------------------
      buffer.elementStart("button");
      buffer.appendAttribute("id", "theId");
      buffer.appendAttribute("type", "button");
      buffer.closeTag();
      buffer.append("Button Text");
      buffer.elementEnd("button);
      -----------------------------

      chained:
      -----------------------------
      buffer.elementStart("button")
      .appendAttribute("id", "theId")
      .appendAttribute("type", "button")
      .closeTag()
      .append("Button Text");
      buffer.elementEnd("button);
      -----------------------------

      or even (to simulate the HTML nesting):
      -----------------------------
      buffer.elementStart("button").appendAttribute("id", "theId").appendAttribute("type", "button") .closeTag()
      .append("Button Text");
      buffer.elementEnd("button);
      -----------------------------

      For more HTML elements and more nesting, the advantage is even more visible.

      #2. If it's possible, please shorten the syntax if possible (e.g. I think "appendAttribute()" is just too long).

        Attachments

          Activity

            People

            • Assignee:
              medgar Malcolm Edgar
              Reporter:
              dkyriakis Demetrios Kyriakis
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: