cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down By index

Former Member
0 Kudos

Dear frds..

I have drop down index say a,b,c

when i selected value a i shoud create a drop down index by

name a and list a values should be populated..

and when i select value to b

then same as above should be done

Thanks

Shravan

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Can you please explain more clearly? Do you want to populate a second drop-down list depending on the selection of the first one?

Armin

Former Member
0 Kudos

Hi,

create two node elements and bind them for those two dropdowns and try this code

in the wddoinit try this

Hashtable verticle = new Hashtable();

verticle.put("a", "a");

verticle.put("b", "b");

sbi = new Hashtable();

sbi.put("a1", "a1");

sbi.put("a2", "a2");

Hashtable mfg = new Hashtable();

mfg.put("b1", "b1");

mfg.put("b2", "b2");

main = new Hashtable();

main.put("a", sbi);

main.put("b", mfg);

Enumeration keys = verticle.keys();

IPrivateCompView.INamesNode nameNode = wdContext.nodeNames();

while (keys.hasMoreElements()) {

IPrivateCompView.INamesElement ele = nameNode.createNamesElement();

ele.setFirst(keys.nextElement().toString());

nameNode.addElement(ele);

and in the first dropdown on select method

write this code

wdContext.nodeSecondnames().invalidate();

IPrivateCompView.ISecondnamesNode secondnode = wdContext.nodeSecondnames();

Hashtable contacts = new Hashtable ();

contacts = (Hashtable) main.get(new String(wdContext.nodeNames().currentNamesElement().getFirst()));

Enumeration tableKeys = contacts.keys();

while (tableKeys.hasMoreElements()) {

String tableKey = tableKeys.nextElement().toString();

String tableValue = contacts.get(tableKey).toString();

IPrivateCompView.ISecondnamesElement ele = secondnode.createSecondnamesElement();

ele.setSecond(tableValue);

secondnode.addElement(ele);

}

and delclare these hashtables in begin others

Hashtable main = new Hashtable();

Hashtable sbi = new Hashtable();

Hashtable mfg = new Hashtable();

iam giving this for two dropdowns

hope this will be helpful

thanks&regards,

ramani

Former Member
0 Kudos

Hi Shravan,

Can you please specify your question more clearly? I am not able to understand your requirement.

Regards,

Gopal