I have page with spring form fields.
They’re bind using command.
Couple of fields in form need to be update based on calculation from other fields.
Those fields can be modified by user.
How can I do that?
I think about trigger java calculation in model using onchanged in web page. But I don’t know how access methods from model and how read fields from page.
I notice, that field are update by setter when page is submit. This is too late if I want calculate ‘live’ when depending fields are changing.
I have page with spring form fields. They’re bind using command. Couple of fields
Share
If you need these calculations to be done on server (java model)… I suggest to use input’s
onChangeevent as you said, send values with AJAX to server and calculate there, returning the result to client again for update UI in real-time.With this approach, you will get the ‘live thing’ you are wondering for.