on 05-22-2007 2:51 AM
All,
I created the checkbox dynamically, but i could not check it at runtime..
Here is my code:
IWDCheckBox cb = (IWDCheckBox) view.createElement(IWDCheckBox.class, "checkbox1" ) ;
cb.bindChecked("Checked_ch1");
cb.setEnabled(true);
cb.setReadOnly(false);
cb.setText("Test Checkbox");
IWDTray cont= (IWDTray) view.getElement("tray1");
cont.addChild(cb);
What is missing...
Thanks in advance..
BM
Hi,
Create the attribute of type boolean and try this code.
IWDAttributeInfo Checked_att=wdContext.getNodeInfo().addAttribute("val1","ddic:com.sap.Boolean");
IWDCheckBox cb = (IWDCheckBox) view.createElement(IWDCheckBox.class, "checkbox1" ) ;
cb.bindChecked(Checked_att);
cb.setEnabled(true);
cb.setReadOnly(false);
cb.setText("Test Checkbox");
IWDTray cont= (IWDTray) view.getElement("tray1");
cont.addChild(cb);
Regards,
Vijai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You forgot to link yours check box with action:
cb.setOnToggle(wdThis.wdGetSomeAction());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check the cardinality of your checkbox node.
If you have created a node for checkbox and trying to add a attribute dynamically to the node,then first set the cardinality of the node to 1..n
or else you have to create the node element for cardinality 0..n
Even i faced the same problem and by changing the checkbox node cardinality to 1..n i was able to check the dynamically created checkbox.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Bharathi,
u have to bind the state of chec box to context attribute which is of type boolean.
cb.bindState(IWDAttributeInfo attributeInfo);
hope this helps to u
With Regards
Naidu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.