Skip to Content
author's profile photo Former Member
Former Member

DropDownByIndex with dynamic content

Hi,

I try to populate a DropDownByIndex element, but result is an empty DropDown.

In View context I have a Node "MyNode" with cardinality 0..n and selection 0..n. and an Attribute "MyValue"

I create a DropDownByIndex and set attribute "Texts" to MyNode.MyValue.

In wdDoInit method I use this code:

ISimpleTypeModifiable myType = wdThis.wdGetAPI().getContext().getModifiableTypeOf("MyNode.MyValue");

myType.setFieldLabel("New label");

IModifiableSimpleValueSet values = myType.getSVServices().getModifiableSimpleValueSet();

values.put("key_1","a");

values.put("key_2","b");

values.put("key_3","c");

but result is an empty DropDown...

Thanks to all

Andrea

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 11, 2005 at 02:41 PM

    Use a dropdownbyKey if you are creating the Simple Value Set.

    If you are sure that what you require is a DropDownbyIndex then you need not create a SimpleValue Set instead just populate the Node Attribute with the values you wish to have in the dropdown.

    eg.

    IPrivate<ViewName>.I<NodeAttribute>Element ele=wdContext.node<nodename>().create<nodename>Element();

    ele.set<Property>(<Value>);

    wdCOntext.node<nodename>().addElement(ele);

    Please do check the syntax for correctness.

    I hope this would be a good guideline for you.

    Regards

    Noufal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2005 at 05:24 AM

    Hi Andrea,

    Check if u've mapped the context correctly. If not try to map the dropdown to the required context dynamically in the WDDoModifyView()

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.