[英]Checkbox have to display in the TABLE YES/NO if it's checked or not
I am trying to get YES or NO when i check the CheckBox. 当我选中复选框时,我试图获取是或否。 I have the code below:
我有下面的代码:
if(cfacebook.isSelected()==true) {
cfacebook.setEnabled(true);
Datos[6]="Yes";
} else { cfacebook.setEnabled(false);
Datos[6]="No";
}
When the CheckBox is checked all is ok the Yes is displayed, and the same when it's unchecked but the Checkbox is now disable and i cannot create a new line. 当CheckBox选中时,一切正常,将显示Yes,而未选中时则显示相同,但Checkbox现在被禁用,我无法创建新行。
Why do you disable cfacebook, when it is not selected? 为什么未选择cfacebook时禁用它?
On line 5, cFaceBook is disabled when not selected. 在第5行上,未选中cFaceBook时被禁用。 So removing line 5 will fix your problem.
因此, 删除第5行将解决您的问题。 With this update, you do not need to enable it again on line 2.(really you do not need it because if it is selectable, already it is enabled)
使用此更新,您无需在第2行再次启用它(确实不需要它,因为如果它是可选的,则已经启用)
1 if(cfacebook.isSelected()==true) {
2 cfacebook.setEnabled(true);
3 Datos[6]="Yes";
4 } else {
5 cfacebook.setEnabled(false);
6 Datos[6]="No";
7 }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.