After finally figuring out my goofy mistake earlier I made some
progress. I have a functioning solution now, but I am puzzled by
some strange behavior I am seeing although I am sure there is a
perfectly reasonable explanation for it. I just can't see it.
I have the following method that creates a name for a checkbox.
tableIndex is bound to the repetition of the table row that
contains the checkboxes.
lastTableIndex is a variable I use to help keep track of when the
column index needs to be reset
colIndex is the column index that I am using for naming purposes.
Notice how the columns count by two? Anyone have any idea why
that might be?
Yes, you are incrementing a variable that is already being
incremented by WORepetition. So it's doubly incremented per item.
How would colIndex be incremented by the WORepetition. It's not
bound to anything. I actually tested the method after removing the
colIndex++ line and nothing is incremented. I get results like
r1c1, r1c1, r1c1, r2c1, r2c1, r2c1. It's almost like the method is
reentrant or something.
Ahh... perhaps I spoke too soon :-) Sounds like you're making it too
hard anyway. If you have something like the following life will be
easy...
ColsRepetition : WORepetition {
list = recordsPerColumn;
item = rowsForColumn;
index = columnIndex;
}
RowsRepetition : WORepetition {
list = rowsForColumn;
item = rowItem;
index = rowIndex;
}
WORepetition will increment columnIndex and rowIndex for you.