checkbox in a table
hi,
i'm using a table to present data.
the table is a multiple choice table, using a checkbox.
after some rows are marked, a certain action is executed using
a button.
when the action is over, i want to do the following for each row -
1. if there was an error during execution, mark the row's background in red.
i managed to do it, using winston Prakash's blog (thanks man!!!!!!! :)))))
2. in case of success, disable the checkbox of the row, so noone will be
able to choose the row again (i don't want to delete it).
my question is - how can i do option #2 ?
it seems that there no connection between the presented data (by using
its rowKey) and the checkbox.
i also tried to get to the checkbox through the table's columns, but the
maximum i got to, was to get to the selected checkboxes, without knowing
to which row (== data), they are connected.
pls assist.
thanks
[985 byte] By [
accs21a] at [2007-11-27 11:35:15]

# 1
Hi!
You can try following:
I) Add getTableRowGroup1().setSelected(boolean selected) method.
or
II)
1) Set 'selectMultipleButton' and 'deselectMultipleButton' table's properties to true.
2) Add JavaScript function:
function selectAllRows(selected) {
var table = document.getElementById("yourForm:yourTable");
table.selectGroupRows(selected);
}
3) Call Set "setTimeout('selectAllRows(true);', 0)" for 'selectMultipleButtonOnClick' and "setTimeout('selectAllRows(false);', 0)" for 'deselectMultipleButtonOnClick' properties.
Thanks,
Roman.
# 2
thanks.
i'm not sure how option II is supposed to work.
i tried it, but it didn't do anything.
pls elaborate.
option I means to select the selected items (if i understood it right).
this is not what i need. i need to be able to disable the checkbox,
once i get a positive answer, regarding a certain row.
thanks a lot.
# 4
hi,
the method checkbox1_processValueChange is activated when the
checkbox is clicked.
there's no problem with that.
what i look for, is another thing:
i have a table. i can select the rows using a checkbox.
after i've selected ALL the required rows, i press on a submit button,
that executes a certain action seperatly for each selected row in the talbe.
once the action is over, i want to let the user know about the outcome
of the action for each row.
when the execution of the row has failed, the row's backgroud is colored with red.
when i succeed, i want to leave the row's background color as is and to disable the checkbox, so the user won't be able to choose it again.
i hope that what i need is more clear now.
thanks.