on 05-18-2006 8:50 AM
Hi,
I created a table and added a checkbox grouped column.
I am using the following code to disable the checkboxes.
IWDCheckBox iwdcb;
IWDTable iwdtbl;
iwdtbl = (IWDTable)view.getElement("tbl");
iwdcb = (IWDCheckBox)iwdtbl.getGroupedColumn(3);
iwdcb.setEnabled(false);
It is throwing a Null Pointer.
Any suggestions.
Regards
Asif
Hello Asif,
Try using the following code for setting the enabled property for the check box column.
for(int i =0; i< wdContext.node<NodeX>.size();i++)
{
wdContext.node<NodeX>.get<NodeX>ElementAt(i).set<AttributeX>(false);
}
Bala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Asif,
It seems that the context variables are not initialized properly. Please check whther during initialization of the app/view you are creating proper objects and binding them to the context nodes or not, like following,
Request_SendEmailPortType_sendEmail req =
new Request_SendEmailPortType_sendEmail();
wdContext.nodeWebServiceEmail().bind(req);
Best regards,
Guru.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First: This code contains several errors.
I guess you get a NPE because there is no view element with ID "tbl" (otherwise you would get a ClassCastException in the next line or because there is no grouped column at index 3 (and the ClassCastException does not occur, but the next line fails).
Second: You shouldn't write code inside wdDoModifyView() to change UI element properties, but rather use data binding.
Create a boolean context attribute "Enabled" under the data source node, say "Rows", of the table, bind the "enabled" property of the checkbox to that attribute.
To disable checkbox in i'th row, set the attribute value of the node element at index i:
wdContext.nodeRows().getRowsElementAt(i).setEnabled(false);
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.