on 02-03-2004 10:52 AM
Hi,
i'm trying to get the checkbox value for each row in a tableView.
TableView table = (TableView) this.getComponentByName("PORevTable");
if (table != null)
{
for (int i = 1; i <= table.getRowCount(); i++)
{
Checkbox chk = (Checkbox) this.getPageContext().getTableComponentForId("PORevTable","chkRev",i);
PortalRuntime.getLogger(IPortalConstants.IVIEW_LOGGER).info(null,chk.isChecked());
}
}
But the problem is that i am using a "disable" and "checked" checkbox (because user cannot uncheck what they already agreed).
My CellRenderer looks like this:
else if (column == 4)
{
Checkbox chk = new Checkbox("chkRev");
if (tableView.getValueAt(row, column).toString().equals("1"))
{
chk.setEnabled(false);
chk.setChecked(true);
}
else
{
chk.setChecked(false);
}
chk.render(rendererContext);
}
When i run it, i ALWAYS get a false value for the "disabled" checkbox.
I saw a method isEnable() for the Checkbox object but it always returns true.
Thanks you for your help,
Marjolaine
Hi Marjolaine,
it is not possible to get the value of disabled controls (like Checkbox, DropdownListBox, etc.), because if they are disabled they cannot be changed and thus you know the actual state (cause you set it). As far as I know only disabled input fields can be read.
Regards,
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marjolaine,
I chekced the docu (how it should work):
checked
A boolean value that that indicates if a checkBox is selected. "True" shows a check mark in a checkBox and indicates that the checkBox is selected, "false" leaves the checkBox empty and indicates that the checkBox is not selected.
isChecked
public boolean isChecked()Check select state.
Returns:
true if Checkbox was/is checked
As far is I know it works, and the sample in PDk also works. I think it you just made a mistake in eventhandling, just follow the sample in PDK.
BR,
Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.