ICEfaces
  1. ICEfaces
  2. ICE-3528

InputTextarea, inputSecret, selectInputText improperly handling boolean passthrough attributes

    Details

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

      Description

      From the forum user chrishantha:
      With InputTextarea and InputSecret, readonly and disabled are not rendered.
      With SelectInputText, even if the input is readonly, I can get the value list and select a value.
      1. RadioRenderer.java
        9 kB
        Krashan Brahmanjara
      2. RadioRenderer.java
        9 kB
        Krashan Brahmanjara
      1. screenshot-1.jpg
        285 kB
      2. screenshot-2.jpg
        303 kB
      3. screenshot-3.jpg
        279 kB

        Activity

        Hide
        Krashan Brahmanjara added a comment -

        Patch for ice:inputtextarea was submitted in attachment to ICE-3514

        Show
        Krashan Brahmanjara added a comment - Patch for ice:inputtextarea was submitted in attachment to ICE-3514
        Hide
        Isuru Perera added a comment -

        SelectOneMenu also doesn't handle pass through boolean attributes

        Show
        Isuru Perera added a comment - SelectOneMenu also doesn't handle pass through boolean attributes
        Hide
        Krashan Brahmanjara added a comment -

        Not fixed yet.

        You forget about ice:selectOneRadio and ice:radio relations.

        For example In spread mode I see that radio's disable/readonly doesn't work. In current version every radio item must by disabled by hand.

        Child radio's should be disabled by parent selectOneRadio tag attribute's.

        In attachment file \core\src\com\icesoft\faces\renderkit\dom_html_basic\RadioRenderer.java with patch (lines signed by //byrt )

        Show
        Krashan Brahmanjara added a comment - Not fixed yet. You forget about ice:selectOneRadio and ice:radio relations. For example In spread mode I see that radio's disable/readonly doesn't work. In current version every radio item must by disabled by hand. Child radio's should be disabled by parent selectOneRadio tag attribute's. In attachment file \core\src\com\icesoft\faces\renderkit\dom_html_basic\RadioRenderer.java with patch (lines signed by //byrt )
        Hide
        Krashan Brahmanjara added a comment -

        Patch for ice:selectOneRadio / ice:radio. Radio item's should be disabled by parent component.

        Show
        Krashan Brahmanjara added a comment - Patch for ice:selectOneRadio / ice:radio. Radio item's should be disabled by parent component.
        Hide
        Krashan Brahmanjara added a comment -

        Another suggestion
        In file com.icesoft.faces.renderkit.dom_html_basic.InputTextRenderer.java, line 42, null may be instead new String[0].

        PassThruAttributeWriter.renderBooleanAttributes(
        writer,
        uiComponent,
        null /new String[0]/ );

        Show
        Krashan Brahmanjara added a comment - Another suggestion In file com.icesoft.faces.renderkit.dom_html_basic.InputTextRenderer.java, line 42, null may be instead new String [0] . PassThruAttributeWriter.renderBooleanAttributes( writer, uiComponent, null / new String [0] / );
        Hide
        Krashan Brahmanjara added a comment -

        Update from revision 17586 to 17613 will change behaviour of ice:radio. i see two another bugs

        • readonly are not aplplied to each ice:radio
        • initial values are not passed and checked attribute are not set

        Patch

        around line 154 is
        < Object[] submittedValue = getSubmittedSelectedValues(uiComponent);
        < Object componentValue = (submittedValue != null) ? null :
        < getCurrentSelectedValues(uiComponent);
        < UISelectOne selectOne = (UISelectOne) forComponent;

        instead component items should be analized

        > UISelectOne selectOne = (UISelectOne) forComponent;
        > Object[] submittedValue = getSubmittedSelectedValues(selectOne);
        > Object componentValue = (submittedValue != null) ? null :
        > getCurrentSelectedValues(selectOne);

        Readonly attributes can be added around line 195 as below

        > Boolean readonly = (Boolean) selectOne.getAttributes().get(HTML.READONLY_ATTR);
        > if (readonly != null && readonly.booleanValue())

        { > input.setAttribute(HTML.READONLY_ATTR, HTML.READONLY_ATTR); > }

        > Boolean disabled = (Boolean) selectOne.getAttributes().get(HTML.DISABLED_ATTR);
        < if (selectItem.isDisabled()) {
        > if (selectItem.isDisabled() || (disabled != null && disabled.booleanValue()))

        { input.setAttribute(HTML.DISABLED_ATTR, HTML.DISABLED_ATTR); }
        Show
        Krashan Brahmanjara added a comment - Update from revision 17586 to 17613 will change behaviour of ice:radio. i see two another bugs readonly are not aplplied to each ice:radio initial values are not passed and checked attribute are not set Patch around line 154 is < Object[] submittedValue = getSubmittedSelectedValues(uiComponent); < Object componentValue = (submittedValue != null) ? null : < getCurrentSelectedValues(uiComponent); < UISelectOne selectOne = (UISelectOne) forComponent; instead component items should be analized > UISelectOne selectOne = (UISelectOne) forComponent; > Object[] submittedValue = getSubmittedSelectedValues(selectOne); > Object componentValue = (submittedValue != null) ? null : > getCurrentSelectedValues(selectOne); Readonly attributes can be added around line 195 as below > Boolean readonly = (Boolean) selectOne.getAttributes().get(HTML.READONLY_ATTR); > if (readonly != null && readonly.booleanValue()) { > input.setAttribute(HTML.READONLY_ATTR, HTML.READONLY_ATTR); > } > Boolean disabled = (Boolean) selectOne.getAttributes().get(HTML.DISABLED_ATTR); < if (selectItem.isDisabled()) { > if (selectItem.isDisabled() || (disabled != null && disabled.booleanValue())) { input.setAttribute(HTML.DISABLED_ATTR, HTML.DISABLED_ATTR); }
        Hide
        Krashan Brahmanjara added a comment -

        Final patch for RadioRenderer, adds READONLY and CHECKED attributes

        Show
        Krashan Brahmanjara added a comment - Final patch for RadioRenderer, adds READONLY and CHECKED attributes
        Hide
        Isuru Perera added a comment -

        HtmlCommandButton also doesn't handle pass through boolean attributes

        Show
        Isuru Perera added a comment - HtmlCommandButton also doesn't handle pass through boolean attributes

          People

          • Assignee:
            Unassigned
            Reporter:
            Mark Collette
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: