on 02-21-2008 7:37 AM
Hi,
I'm having some 5 to 6 drop down UI elements. In all the dropdowns it has a some 10 names listed.
I have to check the condition that, no name has been selected twice.
how to get the selected name of the dropdown and check it with the other dropdowns selected name.
help me out with detailed procedure.
thanks & regards,
Suresh
Hi get the selected item by using the folloeing code
java.lang.String name=wdContext.currentContextElement().getVAName();
Then compare the above value with the other values selected in the dropdownlist
Hazrath.G
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
let you have 5 drop downs binded to value nodes test1,test2,test3,test4,test5 respectively.
The validate method would be
String [] testArr={wdContext.currentTest1Element().getTest(),
wdContext.currentTest2Element().getTest(),
wdContext.currentTest3Element().getTest(),
wdContext.currentTest4Element().getTest(),
wdContext.currentTest5Element().getTest()};
for(int i=testArr.length-1; i>1; i--)
for(int j=0; j<i; j++)
if( testArr<i>.equals(testArr[j]) ){
wdComponentAPI.getMessagemanager.reportWarning("Twice values selected "+testArr<i>);
return;
}
Regards,
Naga
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
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.