Search in sources :

Example 1 with OptionsField

use of com.haulmont.cuba.gui.components.OptionsField in project cuba by cuba-platform.

the class AbstractOptionsBaseLoader method loadDatasource.

@Override
protected void loadDatasource(DatasourceComponent component, Element element) {
    String multiselect = element.attributeValue("multiselect");
    if (StringUtils.isNotEmpty(multiselect)) {
        ((OptionsField) component).setMultiSelect(Boolean.parseBoolean(multiselect));
    }
    String datasource = element.attributeValue("optionsDatasource");
    if (!StringUtils.isEmpty(datasource)) {
        Datasource ds = context.getDsContext().get(datasource);
        ((T) component).setOptionsDatasource((CollectionDatasource) ds);
    }
    super.loadDatasource(component, element);
}
Also used : Datasource(com.haulmont.cuba.gui.data.Datasource) CollectionDatasource(com.haulmont.cuba.gui.data.CollectionDatasource) OptionsField(com.haulmont.cuba.gui.components.OptionsField)

Aggregations

OptionsField (com.haulmont.cuba.gui.components.OptionsField)1 CollectionDatasource (com.haulmont.cuba.gui.data.CollectionDatasource)1 Datasource (com.haulmont.cuba.gui.data.Datasource)1