on 07-30-2008 6:12 AM
Hi
I have binded values to drop down by index with a simple type and defining enumeration. How can i delete the values in the dropdown through code...
Kindly suggest..
Thanks
Prasanthi
Hi,
Normallly for Drop Down by index if you remove the element from the node it should work
IWDNodeElement nodeElement = wdContext.node<YourNode>().getElementAt(<index of theelement to remove>");
wdContext.node<YourNode>().removeElement(nodeElement);
Following is the code that you can use in case of DDbyKey
ISimpleTypeModifiable modifiable = wdContext.getNodeInfo().getAttribute("Your Attribute").getModifiableSimpleType();
ISimpleValueServices simpleValueServices = modifiable.getSVServices();
IModifiableSimpleValueSet simpleValueSet = simpleValueServices.getModifiableSimpleValueSet();
simpleValueSet.removeKey("<key that you need to remove>");
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sorry actually my dropdown was by key...so i used the code given by you for key....
but its giving null pointer exception...
I have craeted a drop down by key and i have created a simple type and given the values in the enumeration and binded this simple type to dropdown through a context attribute.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
When you use the drop down by index you will map texts property to context attribute to populate the data. when you want to delete the items from drop down by index, delete those from the mapped attribute.
is this you wanted? If i misunderstood then let me know...
PradeeP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.