Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-1897

escape value of a selectItem is never evaluated

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.3
    • 1.2.4
    • JSR-252
    • None

    Description

      The escape Attribute of a selectItem Component is not evaluated inside a selectOneRadio component.
      The selectItem Component has a escape member, but the member is never used.

      To fix the problem i've done this:

      HtmlRadioRendererBase.renderGroupOrItemRadio() Line ~199 :

      // label element after the input
      boolean componentDisabled = isDisabled(facesContext, selectOne);
      boolean disabled = (componentDisabled || itemDisabled);
      boolean escape = selectItem.isEscape();

      HtmlRendererUtils.renderLabel(writer, selectOne, itemId,
      selectItem.getLabel(), disabled,escape);

      HtmlRendererUtils.renderLabel() Line ~1352:

      public static void renderLabel(ResponseWriter writer, UIComponent
      component, String forClientId,String labelValue, boolean
      disabled) throws IOException {
      renderLabel(writer, component, forClientId, labelValue, disabled, true);
      }

      /**

      • Renders a label HTML element
        */
        public static void renderLabel(ResponseWriter writer, UIComponent
        component, String forClientId,String labelValue, boolean disabled, boolean escape) throws IOException {

      ...

      if ((labelValue != null) && (labelValue.length() > 0)) {
      writer.write(HTML.NBSP_ENTITY);
      if (escape)

      { writer.writeText(labelValue, null); }

      else

      { writer.write(labelValue); }

      }
      ...

      Attachments

        1. SelectItemEscapeBean.java
          3 kB
          Leonardo Uribe
        2. selectOneManyEscape.jsp
          2 kB
          Leonardo Uribe
        3. tomahawk12-HtmlCheckboxRenderer.patch
          1.0 kB
          Paul Rivera
        4. myfaces-1897-part1.patch
          5 kB
          Paul Rivera
        5. myfaces-1897-part2.patch
          2 kB
          Paul Rivera
        6. selectOneManyEscape-simple.jsp
          2 kB
          Paul Rivera
        7. tomahawk12-HtmlRadioRenderer.patch
          0.7 kB
          Paul Rivera

        Activity

          People

            lu4242 Leonardo Uribe
            joerg-rothbarth Jörg Rothbarth
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: