Hi,
We had the same problem with a checkboxlist. Actually, a html checkbox
does not send a data if it's unchecked. In a simple form, no data means
false so we don't see anything. In a list, that means there are only the
number of true which correspond to the number of checkbox checked.
In order to have a value every time, we create an hidden field with the
checkbox. In the checkbox onchange field there is a small javascript
code that updates the hidden field value (with this method, youh have to
use the status field form iterator). To use data, the checkbox are in
charge of reading from previous action and the hidden fields are in
charge of writting for the next one.
Regards
Sébastien
Reinhard Wagner a écrit :
Hi.
I do have 2 lists in my formbean, one for the checkoxtypes[A,B,C,D] and one for
knowing which checkbox is on / off [checkboxstate]
In my jsp I do iterate over the checkboxtypes List and for every checkboxtype I
generate a struts:checkbox with property set to checkboxstate[index] and value
= 1 ; All works fine except that I'm facing prolem when checkbox isn't checked
in my formbean. Then there are of course only 2 elements in my checkboxstate
list which means that indexes aren't in the right order anymore [when for
example 2nd box was unchecked... ] ..
So in short, is there an easy workaround for this problem. I do have to show
the user checked and unchecked buttons ?
I'm completely new to struts, that's why I'm asking.
THanks in advantage
Rudi
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org