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

How to set the intial value in dropdownbyindex?

Hi All,

I have a small problem for initializing the dropdownbyindex value.

I have created Dropdownbyindex and map the texts value from context value attribute here Context attribute is in inside the three nodes. how can I capture the inside value attribute and how to intialize the value.

My Context nodes are --MainNode

--childnodeOne

--childNode2

--valueAttribute.

The above way my context node strucure and I have mapped this value attribute to dropdownbyindex for this how to initilze the value.

Advance thanks.

Kris.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2006 at 12:53 PM

    Hi

    Assumung you have context structure as follows:

    MainNode(Cardinality 1..1, Sigleton)

    |_ChildNode1(Cardinality 1..1,Non Sigleton)

    |_ChildNode2(Cardinality 0..n,Non Sigleton)

    |_ValueAttribute

    As you said that you have mapped the value attribute which is inside three nodes.

    You can create the values as follows:

    e.g.

    for(int i =0;i < 5; i++)

    {

    IChildNode2Element cn2 = wdContext.createChildNode2Element();

    cn2.setValueAttribute("VA"+i);

    wdContext.currentMainNodeElement().nodeChildNode1().currentChildNode1Element().nodeChildNode2().addElement(cn2);

    }

    This will create 5 values in the drpdown.

    Now to initialize the value you can set the leadselection for the node ChildNode2:

    e.g

    wdContext.nodeChildNode2().setLeadSelection(3);

    This will display the 4th value in the drpdown ibitially.

    To get the value currently selected in dropdown you can write something like this:

    wdContext.currentMainNodeElement().nodeChildNode1().currentChildNode1Element().nodeChildNode2().currentChildNode2Element().getValueAttribute());

    Regards,

    Ajay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2006 at 11:17 AM

    HI,

    Have a look at the threads

    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/91c5e990-0201-0010-4981-9b2075751da5

    http://help.sap.com/saphelp_nw2004s/helpdata/en/dd/b0884118aa1709e10000000a155106/frameset.htm

    Find the node which the attribute you bind is child and

    IPrivate<View>.I<Node>node n=wdContext.Node<Node>

    IPrivate<view>.I<Node>Element e=wdContext.create<Node>Element

    e.set<Attribute>("value");

    n.addElement(e);

    Regards

    Saravanan K

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2006 at 11:20 AM

    Hi,

    do the following steps

    IPrivate<viewName>.IMainNodeNode node=wdContext.nodeMainNode();

    IPrivate<viewName>.IMainNodeElement elem=wdContext.createMainNodeElement();

    elem.setValueAttribute("<value>");

    node.addElement(elem);

    and in the property window of the MainNode set the Selection cardinality to 1..1

    regards

    karthik

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2009 at 11:28 AM

    closing the thread

    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.