Details
-
Type:
Bug
-
Status: Open
-
Priority:
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.
---
<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.
changing com.icesoft.faces.renderkit.dom_html_basic.SelectManyCheckboxListRenderer.java like
280c280
< getCurrentSelectedValues(uiComponent);
—
> getCurrentSelectedValues(forComponent);
seems to fix the issue.