use of org.activityinfo.ui.client.component.form.subform.Tab 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