on 07-03-2009 1:38 PM
Hi,
Is it best practice to have more than one attribute for a node of type dropdown by index? lets say i have 2 dropdowns in my screen,
-Drop (node)
--value1(attribute)
--value2(attribute)
now i created IPrivateXXXView.IDropElement dEle = null;
while(condition){
dEle = wdContext.createDropElement();
dEle.setValue1();//set values of value1
dEle.setValue2();//set values of value2
wdContext.nodeDrop().addElement(dEle);
}
results: my screen shows 2 dropdowns with the values set in while() loop.
But on submit i'm trying to get the values exactly selected in those 2 dropdowns, but i'm not getting the different values as selected..i'm getting the same value as the other ones. if i select some value ex: 7 in box1 on submit the other box2 also changes to 7.
So is the best practice, do i need to maintain separate nodes for these values if yes wt if i have more than 2 attributes?? or any code changes required?
tnx,
-JB
Hi,
The problem is because, when you select an element in the drop down, the current element (wdContext.currentDropElement()) will be changed to that element.
For example you have following elements:
A X
B Y
C Z
Drop down 1 contains A,B,C
Drop down 2 contains X,Y,Z.
If you select B in the drop down 1 then the currentDropElement will be 2nd element that is (B,Y).
when you say
wdContext.currentDropElement().getValue1() returns B
and wdContext.currentDropElement().getValue1() returns Y
If you select C in the drop down 2 then the currentDropElement will be 3rd element that is (C,Z).
when you say
wdContext.currentDropElement().getValue1() returns C
and wdContext.currentDropElement().getValue1() returns Z.
So, to avoid this problem you have to define two nodes for each one.
Drop1Node and Drop2Node.
Regards,
Jaya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You have to create two seperate nodes. If not as the lead selection is same if you select one element in First dropdown , immediately after the next server roundtrip (any action) the lead selection of the second dropdown also changes. So maintain two seperate nodes.
Regards,
Charan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.