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

To avoid duplicate values in DrowpDownByIndex

hi

Iam calling an RFC ,it's output is as following

column 1 column2

A 2

A 3

A 42

B 34

B 3

B 11

B 0

Iam displaying these values in two combo box. But my requirement is as following in first combobox if i select A ,only those values in column 2 which are mapped to A ie(2,3,42) should see in the combobox two.So pls help me i don't know how to do this iam a beginner in webdynprofor java.

I'll give points.......

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 10:19 AM

    Hi,

    You can loop through the node of combo box1:

    List attrList = new ArrayList();

    IPrivate<VIEW NAME>.I<NODE NAME>Element ele = null;

    for(int i = 0;i<wdContext.node<NAME>.size();i++){

    if(wdContext.node<NAME>().get<NAME>elementAt(i).get<ATTR_NAME1>().startWith("A")){

    // ATTR_NAME1 is the attribute mapped to checkbox1.

    // create element of another attribute which should be mapped to checkbox2.

    ele = wdContext.create<NODE NAME>Element();

    ele.set<ATTR NAME2>(wdContext.node<NAME>().get<NAME>elementAt(i).get<ATTR_NAME1>());

    // ATTR_NAME1 is the attribute mapped to checkbox1.

    attrList.add(ele);

    }

    }

    wdContext.node<NAME>.bind(attrList);

    Hope this will solve your problem.

    thanks & regards,

    Manoj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 10:11 AM

    Hi,

    To fill a drop-down list ByIndex you need a context node

    Ex: A node ->Names

    namevalues-> with an attribute of type string

    use a supply function to add and remove items

    Every time the first field changes call invalidate() on node Names.

    Bind the DropDownByIndex element to the context attribute Names.namevalues.

    Regards

    Ayyapparaj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 10:13 AM

    There could be several ways to do this. You can have these values in value node with attributes for say col 1 and next for col 2.

    You can iterate through the value node to check if the value of fst col exists then show the corresponding attribute in 2nd combo box.

    Other way u can have is to use hashmap where u can have the key as the fst col(A,B etc) and the object as comma separated values (numeris ones) for example. you can check if the key exists then show the corresponding values in the second combo box.

    Hope it helps.

    revert in case of queries

    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.