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;
}
Aggregations