ICEfaces
  1. ICEfaces
  2. ICE-3706

attribute value for selectManyCheckbox ignored if layout="spread"

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.7.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Ubuntu Hardy, Tomcat 5.5.27

      Description

      The following two modifications of the "Selection" example from Component Showcase should behave roughly the same:

      ---
                          <ice:selectManyCheckbox id="SlctLang"
                                  value="#{selectionTags.selectedLanguages}"
                                  valueChangeListener="#{selectionTags.effectChangeListener}"
                                  partialSubmit="true">
                              <f:selectItems id="SlctLangItms"
                                              value="#{selectionTags.languageItems}"/>
                          </ice:selectManyCheckbox>
                          <ice:commandButton value="SelectAll" actionListener="#{selectionTags.selectAll}"/>
      ---
                          <ice:selectManyCheckbox id="SlctLang" layout="spread"
                                  value="#{selectionTags.selectedLanguages}"
                                  valueChangeListener="#{selectionTags.effectChangeListener}"
                                  partialSubmit="true">
                              <f:selectItems id="SlctLangItms"
                                              value="#{selectionTags.languageItems}"/>
                          </ice:selectManyCheckbox>
                          <ice:checkbox for="SlctLang" index="0"/>
                          <ice:checkbox for="SlctLang" index="1"/>
                          <ice:checkbox for="SlctLang" index="2"/>
                          <ice:checkbox for="SlctLang" index="3"/>
                          <ice:checkbox for="SlctLang" index="4"/>
                          <ice:commandButton value="SelectAll" actionListener="#{selectionTags.selectAll}"/>
                      </ice:panelGroup>
      ---

      The semantics of the action selectAll is given by the following method:

          public void selectAll(ActionEvent e) {
              selectedLanguages = new String[] { "COBA", "Java", "C", "C#", "C++" };
          }


      While the first example works as expected - the button "checks" all boxes - the second one only updates the panel with displayed values, but the checkboxes' status does not change.

      I do not know (and I am eager to hear) about any workaround to dynamically modify checkbox status.

        Activity

        Hide
        Renzo Zanelli added a comment -

        This fix is for v 1.7.2 SP1 only.

        Show
        Renzo Zanelli added a comment - This fix is for v 1.7.2 SP1 only.
        Hide
        Renzo Zanelli added a comment -

        The fix offered by Martin works. Here is the modified source file for com.icesoft.faces.renderkit.dom_html_basic.SelectManyCheckboxListRenderer.java

        Show
        Renzo Zanelli added a comment - The fix offered by Martin works. Here is the modified source file for com.icesoft.faces.renderkit.dom_html_basic.SelectManyCheckboxListRenderer.java
        Hide
        Martin Volf added a comment -

        changing com.icesoft.faces.renderkit.dom_html_basic.SelectManyCheckboxListRenderer.java like

        280c280
        < getCurrentSelectedValues(uiComponent);

        > getCurrentSelectedValues(forComponent);

        seems to fix the issue.

        Show
        Martin Volf added a comment - changing com.icesoft.faces.renderkit.dom_html_basic.SelectManyCheckboxListRenderer.java like 280c280 < getCurrentSelectedValues(uiComponent); — > getCurrentSelectedValues(forComponent); seems to fix the issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Martin Volf
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: