cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove a value from dropdown

Former Member
0 Kudos

Hi,

I have a dropdown attached to a node-attribute.

this attribute is binded with a dictionary-simple type and its having 3 values.

Now i want to remove only one value from this dropdown through coding.

how to do that ?

please help me

thks

John

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Create a modifiable simple value set for the context attribute and populate it with the original value set except the value you want to remove.

Armin

Former Member
0 Kudos

Hi John

Use the below code , through this you can modify the content of your simple type.

IWDAttributeInfo attr=wdContext.getNodeInfo().getAttribute(" Your Attribute name ");

// or IWDAttributeInfo attr=wdContext.getNodeInfo().getAttribute(" IPublicViewName.IContextElement.AttributeName");

ISimpleTypeModifiable stm=attr.getModifiableSimpleType();

IModifiableSimpleValueSet svs=stm.getSVServices().getModifiableSimpleValueSet();

svs.Removekey ( " Use the key you want to remove "); // check from your simpletype in dictionary.

Hope it helps.

Thanks

Puneet

Answers (2)

Answers (2)

p330068
Active Contributor
0 Kudos

Hi John,

Armin is correct. if you want to remove element from context attribute which is populated to Dictonary. Create another Simple Type in Dictanary with two element

OR Create another node in the context node and attribute and while filling data uisng I<Node Name>Element skip the element which you want to remove.

Hope it helps

Regards

Arun

Former Member
0 Kudos

Hi,

I am assuming you know the position in the drop down from where the value needs to be removed.

You can use :

wdContext.NodeVn_DropDown.removeElementAt(i);

OR

wdContext.NodeVn_DropDown.removeElement(wdContext.nodeVn_DropDown.getVn_DropDownElementAt(i);

Regards,

Himanshu