Search in sources :

Example 1 with SearchPickerField

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

the class SearchPickerFieldLoader method loadComponent.

@Override
public void loadComponent() {
    super.loadComponent();
    SearchPickerField searchPickerField = (SearchPickerField) resultComponent;
    String metaClass = element.attributeValue("metaClass");
    if (!StringUtils.isEmpty(metaClass)) {
        Metadata metadata = AppBeans.get(Metadata.NAME);
        searchPickerField.setMetaClass(metadata.getSession().getClass(metaClass));
    }
    loadActions(searchPickerField, element);
    if (searchPickerField.getActions().isEmpty()) {
        searchPickerField.addLookupAction();
        searchPickerField.addOpenAction();
    }
    String minSearchStringLength = element.attributeValue("minSearchStringLength");
    if (StringUtils.isNotEmpty(minSearchStringLength)) {
        searchPickerField.setMinSearchStringLength(Integer.parseInt(minSearchStringLength));
    }
}
Also used : SearchPickerField(com.haulmont.cuba.gui.components.SearchPickerField) Metadata(com.haulmont.cuba.core.global.Metadata)

Aggregations

Metadata (com.haulmont.cuba.core.global.Metadata)1 SearchPickerField (com.haulmont.cuba.gui.components.SearchPickerField)1