Search in sources :

Example 1 with PeriodTabStrip

use of org.activityinfo.ui.client.component.form.subform.PeriodTabStrip in project activityinfo by bedatadriven.

the class FieldsHolderWidgetContainer method subform.

public static FieldsHolderWidgetContainer subform(final FormDesigner formDesigner, FormField formField, final FormClass subForm, ResourceId parentId) {
    FieldsHolderWidgetContainer container = new FieldsHolderWidgetContainer(formDesigner, subForm, parentId);
    container.isSubform = true;
    container.subFormField = formField;
    container.getPanel().getPanel().setOnRemoveConfirmationCallback(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            formDesigner.getModel().removeSubform(subForm);
            formDesigner.getDropControllerRegistry().unregister(subForm.getId());
            formDesigner.getContainerPresenter().reset();
        }
    });
    container.getPanel().getPanel().getWidgetContainer().setVisible(false);
    if (subForm.getSubFormKind().isPeriod()) {
        container.getPanel().getPanel().getSubformTabContainer().add(new PeriodTabStrip(subForm.getSubFormKind()));
    }
    // force ui update
    container.syncWithModel();
    return container;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) PeriodTabStrip(org.activityinfo.ui.client.component.form.subform.PeriodTabStrip)

Aggregations

ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 PeriodTabStrip (org.activityinfo.ui.client.component.form.subform.PeriodTabStrip)1