src/main/java/org/efaps/ui/wicket/pages/content/form/FormPage.java
public static void updateFormContainer(final Page _page,
                                           final FormContainer _form,
                                           final UIForm _uiForm)
        throws EFapsException
    {

        if (!_uiForm.isInitialized()) {
            _uiForm.execute();
        }
        // the hidden cells must be marked as not added yet.
        for (final IHidden cell : _uiForm.getHidden()) {
            cell.setAdded(false);
        }
        int i = 0;
        final RepeatingView elementRepeater = new RepeatingView("elementRepeater");
        _form.add(elementRepeater);
        for (final Element element : _uiForm.getElements()) {
            switch (element.getType()) {
                case FORM:
                    elementRepeater.add(new FormPanel(elementRepeater.newChildId(), _page, Model.of(_uiForm),
                                    (FormElement) element.getElement(), _form));
                    break;
                case HEADING:
                    final UIHeading headingmodel = (UIHeading) element.getElement();
                    elementRepeater.add(new HeadingPanel(elementRepeater.newChildId(), Model.of(headingmodel)));
                    break;
                case TABLE:
                    i++;
                    final UIFieldTable fieldTable = (UIFieldTable) element.getElement();
                    fieldTable.setTableId(i);
                    final TablePanel table = new TablePanel(elementRepeater.newChildId(),
                                    Model.of(fieldTable), _page);
                    final HeaderPanel header = new HeaderPanel(elementRepeater.newChildId(), table);
                    elementRepeater.add(header);
                    elementRepeater.add(table);
                    break;
                case GRID:
                    final UIFieldGrid grid = (UIFieldGrid) element.getElement();
                    final GridXPanel gridPanel = new GridXPanel(elementRepeater.newChildId(), Model.of(grid));
                    elementRepeater.add(gridPanel);
                    break;
                case CLASSIFICATION:
                    elementRepeater.add(new ClassificationPathPanel(elementRepeater.newChildId(),
                                    Model.of((UIClassification) element.getElement())));
                    break;
                case STRUCBRWS:
                    i++;
                    final UIFieldStructurBrowser strBrwsr = (UIFieldStructurBrowser) element.getElement();
                    strBrwsr.setTableId(i);
                    final StructurBrowserTreeTablePanel strucBrws = new StructurBrowserTreeTablePanel(
                                    elementRepeater.newChildId(), Model.of(strBrwsr));
                    elementRepeater.add(strucBrws);
                    break;
                case SUBFORM:
                    final UIFieldForm uiFieldForm = (UIFieldForm) element.getElement();
                    if (!uiFieldForm.isInitialized()) {
                        if (uiFieldForm.getInstance() == null && uiFieldForm.isCreateMode()) {
                            uiFieldForm.setInstanceKey(_uiForm.getInstanceKey());
                        }
                        uiFieldForm.execute();
                    }
                    final List<Element> elements = uiFieldForm.getElements();
                    for (final Element subElement : elements) {
                        if (subElement.getType().equals(ElementType.FORM)) {
                            elementRepeater.add(new FormPanel(elementRepeater.newChildId(), _page, Model.of(
                                            uiFieldForm), (FormElement) subElement.getElement(), _form));
                        } else if (subElement.getType().equals(ElementType.HEADING)) {
                            elementRepeater.add(new HeadingPanel(elementRepeater.newChildId(), Model.of(
                                            (UIHeading) subElement.getElement())));
                        } else if (subElement.getType().equals(ElementType.TABLE)) {
                            i++;
                            final UIFieldTable fieldTable2 = (UIFieldTable) subElement.getElement();
                            fieldTable2.setTableId(i);
                            final TablePanel table2 = new TablePanel(elementRepeater.newChildId(), Model.of(
                                            fieldTable2), _page);
                            final HeaderPanel header2 = new HeaderPanel(elementRepeater.newChildId(), table2);
                            elementRepeater.add(header2);
                            elementRepeater.add(table2);
                        }
                    }
                    break;
                default:
                    break;
            }
        }
    }
public static void updateFormContainer(final Page _page,
                                           final FormContainer _form,
                                           final UIForm _uiForm)
        throws EFapsException
    {

        if (!_uiForm.isInitialized()) {
            _uiForm.execute();
        }
        // the hidden cells must be marked as not added yet.
        for (final IHidden cell : _uiForm.getHidden()) {
            cell.setAdded(false);
        }
        int i = 0;
        final RepeatingView elementRepeater = new RepeatingView("elementRepeater");
        _form.add(elementRepeater);
        for (final Element element : _uiForm.getElements()) {
            switch (element.getType()) {
                case FORM:
                    elementRepeater.add(new FormPanel(elementRepeater.newChildId(), _page, Model.of(_uiForm),
                                    (FormElement) element.getElement(), _form));
                    break;
                case HEADING:
                    final UIHeading headingmodel = (UIHeading) element.getElement();
                    elementRepeater.add(new HeadingPanel(elementRepeater.newChildId(), Model.of(headingmodel)));
                    break;
                case TABLE:
                    i++;
                    final UIFieldTable fieldTable = (UIFieldTable) element.getElement();
                    fieldTable.setTableId(i);
                    final TablePanel table = new TablePanel(elementRepeater.newChildId(),
                                    Model.of(fieldTable), _page);
                    final HeaderPanel header = new HeaderPanel(elementRepeater.newChildId(), table);
                    elementRepeater.add(header);
                    elementRepeater.add(table);
                    break;
                case GRID:
                    final UIFieldGrid grid = (UIFieldGrid) element.getElement();
                    final GridXPanel gridPanel = new GridXPanel(elementRepeater.newChildId(), Model.of(grid));
                    elementRepeater.add(gridPanel);
                    break;
                case CLASSIFICATION:
                    elementRepeater.add(new ClassificationPathPanel(elementRepeater.newChildId(),
                                    Model.of((UIClassification) element.getElement())));
                    break;
                case STRUCBRWS:
                    i++;
                    final UIFieldStructurBrowser strBrwsr = (UIFieldStructurBrowser) element.getElement();
                    strBrwsr.setTableId(i);
                    final StructurBrowserTreeTablePanel strucBrws = new StructurBrowserTreeTablePanel(
                                    elementRepeater.newChildId(), Model.of(strBrwsr));
                    elementRepeater.add(strucBrws);
                    break;
                case SUBFORM:
                    final UIFieldForm uiFieldForm = (UIFieldForm) element.getElement();
                    if (!uiFieldForm.isInitialized()) {
                        if (uiFieldForm.getInstance() == null && uiFieldForm.isCreateMode()) {
                            uiFieldForm.setInstanceKey(_uiForm.getInstanceKey());
                        }
                        uiFieldForm.execute();
                    }
                    final List<Element> elements = uiFieldForm.getElements();
                    for (final Element subElement : elements) {
                        if (subElement.getType().equals(ElementType.FORM)) {
                            elementRepeater.add(new FormPanel(elementRepeater.newChildId(), _page, Model.of(
                                            uiFieldForm), (FormElement) subElement.getElement(), _form));
                        } else if (subElement.getType().equals(ElementType.HEADING)) {
                            elementRepeater.add(new HeadingPanel(elementRepeater.newChildId(), Model.of(
                                            (UIHeading) subElement.getElement())));
                        } else if (subElement.getType().equals(ElementType.TABLE)) {
                            i++;
                            final UIFieldTable fieldTable2 = (UIFieldTable) subElement.getElement();
                            fieldTable2.setTableId(i);
                            final TablePanel table2 = new TablePanel(elementRepeater.newChildId(), Model.of(
                                            fieldTable2), _page);
                            final HeaderPanel header2 = new HeaderPanel(elementRepeater.newChildId(), table2);
                            elementRepeater.add(header2);
                            elementRepeater.add(table2);
                        }
                    }
                    break;
                default:
                    break;
            }
        }
    }
Method used to update the Form Container.

@param _page page
@param _form formcontainer
@param _uiForm model
@throws EFapsException on error