use of org.activityinfo.ui.client.component.form.subform.SubFormPanel in project activityinfo by bedatadriven.
the class FormWidgetCreator method createSubformPanel.
public SubFormPanel createSubformPanel(FormClass subForm, int depth, RelevanceHandler relevanceHandler, PanelFiller filler) {
final SubFormPanel panel;
if (subForm.getSubFormKind() == SubFormKind.REPEATING) {
panel = new RepeatingSubFormPanel(subForm, model);
} else {
panel = new PeriodSubFormPanel(model, subForm, relevanceHandler, filler, depth);
}
subformPanels.put(subForm, panel);
return panel;
}
use of org.activityinfo.ui.client.component.form.subform.SubFormPanel in project activityinfo by bedatadriven.
the class SimpleFormPanel method getSelectedKey.
/**
* Returns selected key/tab for given field or otherwise null if nothing is selected or it is root instance (no key).
*
* @return selected key/tab for given field or otherwise null if nothing is selected or it is root instance (no key).
*/
public String getSelectedKey(FormField field) {
FormClass formClass = model.getClassByField(field.getId());
if (formClass.isSubForm()) {
SubFormPanel subformPanel = widgetCreator.getSubformPanel(formClass);
if (subformPanel instanceof PeriodSubFormPanel) {
PeriodSubFormPanel periodSubFormPanel = (PeriodSubFormPanel) subformPanel;
Tab selectedTab = periodSubFormPanel.getSelectedTab();
if (selectedTab != null) {
return selectedTab.getId();
}
}
}
return null;
}
Aggregations