Search in sources :

Example 1 with ListComponent

use of io.jmix.ui.component.ListComponent in project jmix-sneferu by mariodavid.

the class SelectInListInteraction method execute.

@Override
public void execute(ScreenTestAPI screenTestAPI) {
    ListComponent listComponent = (ListComponent) screenTestAPI.component(componentDescriptor).rawComponent();
    if (values.size() > 1 && !listComponent.isMultiSelect()) {
        throw new IllegalArgumentException("Cannot select multiple values for component with multiselect='false'");
    }
    listComponent.setSelected(values);
}
Also used : ListComponent(io.jmix.ui.component.ListComponent)

Example 2 with ListComponent

use of io.jmix.ui.component.ListComponent in project jmix by jmix-framework.

the class RelatedEntitiesLoader method loadComponent.

@Override
public void loadComponent() {
    assignFrame(resultComponent);
    loadCaption(resultComponent, element);
    loadIcon(resultComponent, element);
    loadWidth(resultComponent, element);
    loadStyleName(resultComponent, element);
    loadEnable(resultComponent, element);
    loadVisible(resultComponent, element);
    loadAlign(resultComponent, element);
    loadCss(resultComponent, element);
    loadOpenMode(resultComponent, element);
    loadString(element, "exclude", resultComponent::setExcludePropertiesRegex);
    for (Element routeObject : element.elements("property")) {
        loadPropertyOption(routeObject);
    }
    String listComponentId = loadString(element, "for").orElseThrow(() -> new GuiDevelopmentException("'for' attribute of related entities is not specified", context, "componentId", resultComponent.getId()));
    getComponentContext().addPostInitTask((context1, window) -> {
        if (resultComponent.getListComponent() == null) {
            Component bindComponent = resultComponent.getFrame().getComponent(listComponentId);
            if (!(bindComponent instanceof ListComponent)) {
                throw new GuiDevelopmentException("Specify 'for' attribute: id of table or tree", context1, "componentId", resultComponent.getId());
            }
            resultComponent.setListComponent((ListComponent) bindComponent);
        }
    });
    loadTabIndex(resultComponent, element);
}
Also used : Element(org.dom4j.Element) GuiDevelopmentException(io.jmix.ui.GuiDevelopmentException) ListComponent(io.jmix.ui.component.ListComponent) ListComponent(io.jmix.ui.component.ListComponent) Component(io.jmix.ui.component.Component)

Aggregations

ListComponent (io.jmix.ui.component.ListComponent)2 GuiDevelopmentException (io.jmix.ui.GuiDevelopmentException)1 Component (io.jmix.ui.component.Component)1 Element (org.dom4j.Element)1