Skip to Content
avatar image
Former Member

How to remove a value from dropdown

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 13, 2010 at 07:07 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • avatar image
    Former Member
    Apr 13, 2010 at 04:32 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 14, 2010 at 05:57 AM

    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

    Add comment
    10|10000 characters needed characters exceeded