Dynamic form generation
Martin Paoletta <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, I need to generate forms dynamically. A form is a collection of controls (input elements, grids, buttons). The exact composition of the form (what elements it does include) is known only at runtime (it changes). I came up with the following approach: My FormModel should have an item elements that returns an iterative model with the form elements. Those elements are components. The problem I currently have is that components should bind to html nodes that my template doesn´t have (I only have a <span id="Form">[Form]</span> node). How can I import those nodes (I do have additional templates for each element (text, select, grids, etc) that I want to use) into the master template. Models return strings, components or nodes. I want to return processed nodes or components that generate their nodes by importing them from other templates. Perhaps there is another aproach that I haven´t thought of. Thanks in advance, Martin Paoletta