IDEMPIERE-69 Product Attribute Grid - Cols and rows always missing one entry

This commit is contained in:
Dirk Niemeyer 2011-09-18 11:07:24 -05:00
parent fc7bce6434
commit 628b436cdf
2 changed files with 12 additions and 12 deletions

View File

@ -329,7 +329,7 @@ public class VAttributeGrid extends CPanel
xValues = m_attributes[indexAttr1-1].getMAttributeValues();
if (xValues != null)
{
cols = xValues.length;
cols = xValues.length + 1;
log.info("X - " + m_attributes[indexAttr1-1].getName() + " #" + xValues.length);
}
@ -340,7 +340,7 @@ public class VAttributeGrid extends CPanel
yValues = m_attributes[indexAttr2-1].getMAttributeValues();
if (yValues != null)
{
rows = yValues.length;
rows = yValues.length + 1;
log.info("Y - " + m_attributes[indexAttr2-1].getName() + " #" + yValues.length);
}
@ -356,11 +356,11 @@ public class VAttributeGrid extends CPanel
for (int col = 0; col < cols; col++)
{
MAttributeValue xValue = null;
if (xValues != null)
xValue = xValues[col];
if (xValues != null && col > 0)
xValue = xValues[col - 1];
MAttributeValue yValue = null;
if (yValues != null)
yValue = yValues[row];
if (yValues != null && row > 0)
yValue = yValues[row - 1];
// log.fine("Row=" + row + " - Col=" + col);
//
if (row == 0 && col == 0)

View File

@ -405,7 +405,7 @@ public class WAttributeGrid extends ADForm implements EventListener
}
}
if (xValues != null)
noOfCols = xValues.length;
noOfCols = xValues.length + 1;
// y dimension
int noOfRows = 2;
@ -426,7 +426,7 @@ public class WAttributeGrid extends ADForm implements EventListener
}
if (yValues != null)
noOfRows = yValues.length;
noOfRows = yValues.length + 1;
gridView.getChildren().clear();
@ -443,11 +443,11 @@ public class WAttributeGrid extends ADForm implements EventListener
for (int colIndex = 0; colIndex < noOfCols; colIndex++)
{
MAttributeValue xValue = null;
if (xValues != null)
xValue = xValues[colIndex];
if (xValues != null && colIndex > 0)
xValue = xValues[colIndex - 1];
MAttributeValue yValue = null;
if (yValues != null)
yValue = yValues[rowIndex];
if (yValues != null && rowIndex > 0)
yValue = yValues[rowIndex - 1];
if (rowIndex == 0 && colIndex == 0)
{