I need to create a dynamic form in grails which has various dynamically created input boxes at runtime, which then submits its params to a controller just like a form created at compile time. Any ideas?
The view gsp might look like this:
<g:form controller="report" action="view">
<input type="submit" value="Submit">
<!-- insert some inuput params here at runtime -->
</g:form>
and the action controller would be:
class ReportController {
def view = {
def someDynamicParam = "someParam"
if (params["someParam"] != null) {
...
}
The problem is I have no idea how to render the form input fields in a way that grails will understand them on submission.
grails install-templatesand have a look at the script which is used to generate scaffolding views. There may be a hint or two in there. - zoran119