on 05-26-2005 3:12 PM
Hello,
I have a combo box with values.
I would like to create a button that by clicking it will clear the selection.
I tried to use:
wdContext.node<NodeName>().clearSelection();
But it doesn't clear the combo box. So how do I do it?
Hi,
Try this.
wdContext.current<<NodeElement>>.set<<Attrib>>("");
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Roy,
Using clear slection it only clears the current selection value. But if you want to remove all the contents Do one thing.
suppose your vie name is testview and node name is node1
in this node attribute is value1.
iprivatetestviw.inodenode1 n1 = wdcontext.nodenode1();
for (int i = n1.size() - 1; i >= 0; i--)
{
IPrivatetestView.Inode1Element myElement =
wdContext.nodeNode1().getNode1ElementAt(i);
wdContext.nodeNode1().removeElement(myElement);
}
Using this code you can clear your contents in node so in turn from Dropdown list.
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Javadoc for IWDAbstractDropDownByKey explains how data binding works:
<b>Data binding:</b>
The set of selectable keys, displayed texts and the selected key are retrieved from a context. This context must provide an attribute y of a type having a value set. The selectable keys of the drop-down list are the keys of this value set, the displayed texts are the corresponding values. <b>The currently selected key is the current value of the attribute y</b>.
The property selectedKey must be bound to the attribute y.
Example: Let there be a root level attribute with name "Att" that contains the selected key and provides the value set. Then you must bind the "selectedKey" property of the drop-down list to attribute "Att". To clear the selection, use
wdContext.currentContextElement().setAtt(null)
Armin
What do you mean by "combo box"? I suppose you mean one of the two drop-down list box variants?
To clear the selection of a
- IWDDropDownByKey: Assign null to the context attribute to which property "selectedKey" is bound.
- IWDDropDownByIndex: Clear the lead selection (set to -1) of the context node which serves as data source.
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 |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
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.