ICEfaces
  1. ICEfaces
  2. ICE-3416

The content of <script> tags are being wrapped by <span> tags.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.1
    • Fix Version/s: 1.7.2
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      all

      Description

      Putting a script into an ICEfaces page

      <script type="text/javascript">
      alert("Beep");
      </script>

      Currently gets rendered out as:

      <script type="text/javascript">
      <span id = "_components_buttonsAndLinks_WAR_componentshowcase_INSTANCE_2nr4_ :j_id4">alert("Beep");</span>
      </script>

      Wrapping the contents in a <span> causes the code to, obviously, not execute. The problem surfaces in the 1.7 branch on revision 17279.

      The problem according to Mark is:

      With JSF 1.1, generated ids are of the form _idNUMBER, whereas with JSF 1.2, they are j_id_NUMBER.

      In TextRenderer, part of the logic to have a span is:

      if (idNotNull(uiComponent) && !uiComponent.getId().startsWith("_")) {
        return true;
      }

      Which means, if the component has an id, and it was specifically given, and not generated, than use a span. But the heuristic for it not being generated was for JSF 1.1, not JSF 1.2. It worked out, because we had put in place our own generated id scheme, for plain text, that was _iceIDNUMBER, which started with the underscore. Changing that to use the JSF 1.2 generated id broke things.

      The solution is not to back out the generated id fix. Instead we could update TextRenderer to use a better heuristic for having a specified id. Or we could just set a flag on OutputText, so it will just not put spans around plain text. There's the little question of when <ice:outputText> is used (and not plain text), and no id was given, so it's generated, what we're supposed to do, use a span or not.

        Issue Links

          Activity

          Deryk Sinotte created issue -
          Deryk Sinotte made changes -
          Field Original Value New Value
          Component/s Components [ 10012 ]
          Fix Version/s 1.7.2 [ 10130 ]
          Affects Version/s 1.7.1 [ 10122 ]
          Assignee Mark Collette [ mark.collette ]
          Deryk Sinotte made changes -
          Link This issue blocks ICE-3315 [ ICE-3315 ]
          Ken Fyten made changes -
          Assignee Priority P3
          Ken Fyten made changes -
          Assignee Priority P3 P1
          Ken Fyten made changes -
          Assignee Mark Collette [ mark.collette ] Yip Ng [ yip.ng ]
          Ken Fyten made changes -
          Link This issue depends on ICE-1931 [ ICE-1931 ]
          Ken Fyten made changes -
          Fix Version/s 1.7.2RC1 [ 10140 ]
          Fix Version/s 1.7.2 [ 10130 ]
          made changes -
          Attachment screenshot-1.jpg [ 11231 ]
          made changes -
          Attachment screenshot-2.jpg [ 11233 ]
          made changes -
          Attachment screenshot-3.jpg [ 11234 ]
          yip.ng made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Fix Version/s 1.7.2 [ 10130 ]
          Fix Version/s 1.7.2RC1 [ 10140 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Priority P1
          Assignee Yip Ng [ yip.ng ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Deryk Sinotte
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: