Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.1
-
Fix Version/s: 1.5.2
-
Component/s: ICE-Components
-
Labels:None
-
Environment:Operating System: Windows XP
Platform: PC
Description
from the forum: http://www.icefaces.org/JForum/posts/list/3036.page
riginal code
Code:
if (selectedClass != null) {
tr.setAttribute(HTML.CLASS_ATTR, selectedClass);
} else if (rowStylesMaxIndex >= 0) {
// if row styles exist, then render the appropriate one
tr.setAttribute(HTML.CLASS_ATTR, rowStyles[rowStyleIndex]);
if (++rowStyleIndex > rowStylesMaxIndex) {
rowStyleIndex = 0;
}
}
Proposed code
Code:
if (selectedClass != null) {
tr.setAttribute(HTML.CLASS_ATTR, selectedClass);
rowStyleIndex++; // !!! here is the difference.
} else if (rowStylesMaxIndex >= 0) {
// if row styles exist, then render the appropriate one
tr.setAttribute(HTML.CLASS_ATTR, rowStyles[rowStyleIndex]);
if (++rowStyleIndex > rowStylesMaxIndex) {
rowStyleIndex = 0;
}
}
riginal code
Code:
if (selectedClass != null) {
tr.setAttribute(HTML.CLASS_ATTR, selectedClass);
} else if (rowStylesMaxIndex >= 0) {
// if row styles exist, then render the appropriate one
tr.setAttribute(HTML.CLASS_ATTR, rowStyles[rowStyleIndex]);
if (++rowStyleIndex > rowStylesMaxIndex) {
rowStyleIndex = 0;
}
}
Proposed code
Code:
if (selectedClass != null) {
tr.setAttribute(HTML.CLASS_ATTR, selectedClass);
rowStyleIndex++; // !!! here is the difference.
} else if (rowStylesMaxIndex >= 0) {
// if row styles exist, then render the appropriate one
tr.setAttribute(HTML.CLASS_ATTR, rowStyles[rowStyleIndex]);
if (++rowStyleIndex > rowStylesMaxIndex) {
rowStyleIndex = 0;
}
}
Changed code to the following to avoid an array out of bounds exception.
Check in r12592 in 1.5 branch
if (selectedClass != null)
{ tr.setAttribute(HTML.CLASS_ATTR, selectedClass); }else if (rowStylesMaxIndex >= 0)
{ // if row styles exist, then render the appropriate one tr.setAttribute(HTML.CLASS_ATTR, rowStyles[rowStyleIndex]); }if(rowStylesMaxIndex >= 0){
{ rowStyleIndex = 0; }if (++rowStyleIndex > rowStylesMaxIndex)
}