Hi, I am having a strange problem with my custom datatype that I hope someone can help me with.
I am trying to allow the user to define their own format pattern for certain BigDecimal attributes. So for example some users may want to see/enter 0.3344 if they define “#0.0000” or see/enter 33.44% if they define “###.00%”. Because the format is dynamic, I am unable to use the new @NumberFormat annotation.
So I created my own custom Datatype that can be created with a format pattern. It works fine. I can assign “##0.00%”, which allows me to enter 33.44% in the editor and save 0.3344 to the database. But I have a problem if I make the attribute required. The value shows as expected in the WebTextField but upon saving, I get the alert: Growth Rate required.
This problem only occurs when using the percent format pattern. Although the datatype is able to format the value and parse the String, I guess the Validator does not like the % character and thinks there is nothing there…
Should I be doing something else? Thanks.