on 06-29-2007 6:51 AM
I hope somebody could give me some advice.
I have a dropdown by index in my WD app which has an action bound to it. This action gets the current selection as a string. If the user happens to select the empty slot which the dropdown has by default at the top, the app crashes and displays a NullPointerException. No help if I try to validate whether the string var is null or try to calculate the length or anything. Every time the app tries to get the current selection (when the empty slot is selected) and put it in to a variable or perform some other operation on it, it crashes.
How to circumvent this?
Regards,
Erno
Hi,
Check the value of dropwown by Index like this
if(wdContext.node<Node>().getLeadSelection()==-1)
{
wdComponentAPI.getMessageManager().reportWarning("Select a value");
}
Regards
Fahad Hamsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you don't want the empy entry at all, set selection cardinality of the node to 1:1 instead of 0:1.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great! Thanks for the hint.
Problem solved and points assigned..
-e
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.