I am trying to create a form which will add the user record in the database. When i click the submit button, it looks like that form is not submitted. In the debug mode, its not going inside onSubmit. I am not seeing any exception.
On the form level, there is an input field "status", and on the bean side i have an enum Status. So how to map this? How to do mapping for this kind of thing. I suspect form save problem is because of this.
So i have two questions here:
1. how to map a form field to bean's enum.
2. any reason onSubmit is not called?
Can you guys give me an example how to write custom property editor for enum, how to register with binder and how to specify this form field value should map to bean's enum.
I am now able to save the form with string, date and enum values. There is one problem while saving enums, instead of the actual enum value, its saving the index value of enums. I also tried creating a custom property editor for enum, but its storing 0, 1, 2 etc, not storing the real string values which i want to save.
See my code below:
So above is all the code i am having. No matter i use enum property editor or not, it always inserts index values instead of text.