Does anyone know what exactly is Dynamic about Primefaces Extension's Dynaform.There doesn't seem to be anything dynamic about the dynamic form example. As far as I can tell this is just a form with a fixed layout and fixed input components. Not what I expected given the statement on the front page:
Normally we can build a form quite straightforward by h:panelGrid oder p:panelGrid if the count of rows / columns, positions of elements, etc. are known. That's true for static forms. But it's not possible to use h:panelGrid oder p:panelGrid if a form is described dynamically, at runtime. E.g. if the entire form's definition is placed in a database or a XML file.
DynaForm makes possible to build a dynamic form with labels, inputs, selects and other elements by model. Other enhancements are expandable extended view area (grid), autoSubmit feature, widget's client-side API, various facets. Supported facets
One of the Primefaces Extension authors explains it in a bit more detail on his blog : http://ovaraksin.blogspot.hu/2012/06/dynamic-forms-jsf-world-was-long.html .
The important part is:
Child tag pe:dynaFormControl matches created in Java controls by "type" attribute. This is usually a "one to many" relation.
You don't define the layout in the xhtml page, you just create some custom components you reference in your java code.
In the basicUsage example you can see this:
<pe:dynaFormControl type="calendar" for="cal">
<p:calendar id="cal" value="#{data.value}" />
</pe:dynaFormControl>
This creates a calendar control type, that is implemented using p:calendar
. You can reference it in your backing bean:
DynaFormControl control = row.addControl(property, "calendar", 1, 1);