This example demonstrates how to use nested model. You can picture it as a table contained in a cell. This is very useful when your control is a combination of
pe:dynaFormControl. Note, XHTML code with pe:dynaForm stays the same, only Java model gets changed. Main steps:
- Create parent model instance: DynaFormModel model = new DynaFormModel();
- Add row, label, control and set relationship as you would do in normal case,
- Create nested model instance: DynaFormModel nestedModel = new DynaFormModel();
- Add row to regular grid: DynaFormRow nestedRow = nestedModel.createRegularRow();
- Add label, control and set relationship as usual,
- Add nested model: nestedRow.addModel(data, type, colspan, rowspan);