i have written 2 iterators with a textfield inside the inner iterator as shown below:
the name attribute (added_by) of the textfield is an array. the above code will fail because value of inner.index will reset to 0 on every iteration of outer loop. how to set index value to (inner.index * outer.index + inner.index)? i tried writing this mathematical formula to array index but it does not work. please help me in resolving it. Thanks.
You're using essentially random OGNL syntax. The "#" needs to be before each local variable (unless you're using S2.1+, in which case you may or may not need it at all).
Joined: Jun 28, 2007
thanks newton. it works after adding #.
and as you stated the correct formula is index * inner size + inner index. but now the problem is getting the size value of inner iterator.
I checked IteratorStatus API but there is no size property. i tried the size property of list, but, both second.size and second.length are returning null values. so, how can i get the size of the inner iterator? please guide me.