Now, DWR will be used for creating the forms as well. This will be done mostly to easily relay errors, such as syntax errors in the Controller and the Model of the groovy form. Don't fear, I'm going to go overboard with AJAX! It'll only be used up until the point of where templates are generated. After that point, a Servlet will take over the bulk of the work (I am undecided on the Servlet bit.).
Now what's next? Several things need to happen.
First, creating the form:
- We need to validate that form fields are not empty; also the input must be checked for validity.
- The model's syntax needs to be compiled and syntax errors need to be relayed to the user.
- We need to get the fields of the class and store them.
- We need to generate templates like: <%= textArea(...); %> -- They will not be run it through the template engine immediately until the user has confirmed what they want,
- After the view has been tweaked -- it is run through the template engine; at this point we will also run the controller through and generate that and present it at the same time the final view is presented.
- The user will be presented with the HTML of the view and Groovy controller and given a final opportunity to tweak it before it is saved to the system.
- The form is added to the system -- by default the form is not published.
- Finally, to publish the form so that it can be used to enter data, they go to the management screen and tick the checkbox.
- The form is now ready to be used for data entry.
First one contains one form which is published, the rest are not. The second, no forms are published.
The user interface is intuitive and easy to use. It's a great design, of course I'm biased since It was was me who designed it.