-
FEATURED COMPONENTS
First time here? Check out the FAQ!
HI,
I declare a Decimalbox in ZUL.
set maxLength of DecimalBox = 15.
set Format = #,###.##
At run time of Execution I entered Number with 15 digits and come out from Decimal box. Immediately it calls onblur event in backend and entered 15 digit number splitted with comma(",") and add rational 2 digits at the end. then it Shows a error for entering length of Number greater than 15. What is the solution to neglect the calculation of comma's in length of DecimalBox value. But set format of that value is necessary.
Example:
value I entered: 123456789456789
After Blur value in Decimal box: 123,456,789,456,789.00
So Total length of value becomes 22. then it shows Error to reach of max value 15.
Can anybody give me a solution to solve this...
Thanks in Advance
With Regards,
Siva Kumar
i got the same problem. but no one answered this even after 10 months....... :(
I think that all maxlength functionality is wrong in ZK. For example when you need to show a form with values from different source. When these values exceed maxlength, your form will not appear and WrongValueException is thrown. That's why I use my own maxlength validation. I am using my own Constraints which can handle more validation requirements than only one. I have constraint which throws MandatoryFieldException, MaxLengthException and InvalidFormatException in method validateThrowing(). This method is then called from method validate(), where I can handle my own reaction on validation error. For example highlight invalid inputs. Then my form is shown even if values are not valid. Bad thing is that you are not stopped from writing when you exceed max length limit.
I had similar problem and now for BigDecimal I use generated maxvalue for compare. For example when you have maxlength 13 and your decimal has scale 4, then you generate string from "." appending 4 * '9' and prepending '9' to total length 13.
OMG, I just realized that this is soooo old question... Sorry for that
I can not use maxlength in decimalbox, but i use [if (IDDECIMAL.getText().replace(",", "").length()>15) { showNotification("OVER 15 LETTER"); IDDECIMAL.focus(); return false; }]
Asked: 2012-01-06 11:36:13 +0800
Seen: 349 times
Last updated: Oct 30 '18