cancel
Showing results for 
Search instead for 
Did you mean: 

How to check if a dropdown element is selected or not

Former Member
0 Kudos

Hi all

I have a dropdownbykey UI element .it's getting value from EJB's.I want to perform a check to find if user has selected any element from it or not when I press a Submit button.Note that it is showing blank innthe dropdown initially.

Thanks

Ananda

View Entire Topic
Former Member
0 Kudos

Check the value of the context attribute to which the "selectedKey" property of the drop-down list is bound.

Armin

Former Member
0 Kudos

Hi

I have used this code to check context value attribute of type string

wdContext.currentContextElement().get<context_element>().equals(null)

and also

wdContext.currentContextElement().get<context_element>().length()==0

but none of them is working.

Help !!

Thanks

Ananda

Former Member
0 Kudos

hi ananda,

display the value of wdContext.currentContextElement().get<context_element>()

using

wdComponentAPI.getMessageManager.reportSuccess(wdContext.currentContextElement().get<context_element>())

before the check and see what is coming]

Regards

Rohit

Former Member
0 Kudos

Hi

I have used your suggestion and found that it is returning null.So I checked with following code

wdContext.currentContextElement().get<context_element>().equals("null")

but still it is giving NullpointerException

Please help

Ananda

Former Member
0 Kudos

Use

wdContext.currentContextElement().get<context_element>() == null

Armin