cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByKey problem!

Former Member
0 Kudos

Hi all,

Have a doubt about DropDownByKey UI Element.

I have a DropDownByKey with information from a Simple Type from my Local Dictionary. I when I run my application, I have to compare the value that I select from my Dropdownbykey with another string... he code I'm using for this is..

String str1 =

(String) wdContext.currentContextElement.getcontext1();

String str2 =

(String) "Test";

if (str1 == str2) {

//do something

}

else {

//do something

}

So, the problem is...when I try to compare this two strings and I already know they are the same, the program also takes de else option and never goes throught the if condition.

Please, help me with this...

Thanks in advance,

Jesus

View Entire Topic
Former Member
0 Kudos

Jesus,

Just a wild Guess...! Are you using '==' to compare the strings. (It compares the objects). If so use .equals() or .equalsIgnoreCase().

If this is not the case, pls let me know. I'll send you the code for this.

Hope this helps,

Best Regards,

Nibu.

Former Member
0 Kudos

Ok, Thank you very much to Nibu and Santhosh. It was very helpful your answer and it helped me to sove my problem.

Regards,

Jesus