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);
}
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);
}
Aggregations