on 05-02-2008 10:14 PM
Hiee..,I have a filed and it has data..,it can hold either numeric or string value..,I want to know whether it has a numeric value or string..,by that I have to do some other requirement
please help..
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can try parsing the input. If it is not integer, then that is a string.
onAction check input field
String temp = wdContext.currentContextElement().getInputValue();
try{
int value = Integer.parseInt(temp);
// you can do rest coding for integer input.
wdComponentAPI.getMessageManager().reportSuccess("input is integer");
}catch(NumberFormatException e){
// do coding for string input
wdComponentAPI.getMessageManager().reportSuccess("input is alphanumeric");
nikhiL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not 100% sure what you are asking. But, assuming you are starting with a String field of some kind, you can try to parse it to a number. If you get an exception, then it isn't a number.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.