on 11-15-2008 2:46 PM
Hi
I have label BASIC PAY and input field,for that input field i have binded amodel attribute of type bigdecimal.now that input field should not accept negative values,can u please tell me how to write acode sothat that input should accept only positive values.
Thanks
Krishna
Hi Krishna,
first put a validation check
try{
if{wdcontect.currentContextElement.getamodel()>0.0|| wdcontect.currentContextElement.getamodel()=0.0)
{
-
-
}
}
catch(Exception e)
{
wdComponentAPI.getMessageManager().reportSuccess("Please enter positive values");
}
Regards
Khushboo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krishna,
Create one value attribute and bind that to a simple type(double) dictionary , in that dictionary give ur min value as 0 and max as per reqd.
if any doubt let me know.
Thanks & Regards
Manoj Sahoo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The attribute is "decimal", a built-in type in WebDynpro that translates to Java BigDecimal type. If you do not want to allow a negative value to enter in the InputField you can code a validation function when you submit the data to the server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> how to convert bigdecimal to double in webdynpro java
Hi,
Try this:
double x = wdContext.currentContextElement().getBigdecimalAttribute().doubleValue();
Refer methods applicable on Bigdecimal here -
http://code.google.com/android/reference/java/math/BigDecimal.html
Regards,
Anagha
Edited by: Anagha Jawalekar on Nov 17, 2008 12:08 PM
User | Count |
---|---|
93 | |
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.