use of io.jmix.uidata.app.filter.configuration.UiDataFilterConfigurationModelFragment in project jmix by jmix-framework.
the class UiDataFilterSupport method createFilterConfigurationFragment.
@Override
public ScreenFragment createFilterConfigurationFragment(FrameOwner owner, boolean isNewConfiguration, Filter.Configuration currentConfiguration) {
FilterConfiguration configurationModel = loadFilterConfigurationModel(isNewConfiguration, currentConfiguration);
boolean defaultForMeFieldVisible = isDefaultForMeFieldVisible(currentConfiguration, configurationModel);
registerConfigurationDc(configurationModel, owner);
Fragments fragments = UiControllerUtils.getScreenContext(owner).getFragments();
UiDataFilterConfigurationModelFragment fragment = fragments.create(owner, UiDataFilterConfigurationModelFragment.class);
fragment.setDefaultForMeFieldVisible(defaultForMeFieldVisible);
return fragment;
}
use of io.jmix.uidata.app.filter.configuration.UiDataFilterConfigurationModelFragment in project jmix by jmix-framework.
the class UiDataFilterSupport method getFragmentFilterConfigurationModel.
protected FilterConfiguration getFragmentFilterConfigurationModel(Filter.Configuration configuration, ScreenFragment configurationFragment) {
Filter filter = configuration.getOwner();
FilterConfiguration configurationModel;
if (configurationFragment instanceof UiDataFilterConfigurationModelFragment) {
ScreenData screenData = UiControllerUtils.getScreenData(configurationFragment.getHostController());
InstanceContainer<FilterConfiguration> configurationDc = screenData.getContainer(CONFIGURATION_CONTAINER_ID);
configurationModel = configurationDc.getItem();
if (filter.getId() != null && filter.getFrame() != null && ((UiDataFilterConfigurationModelFragment) configurationFragment).getDefaultForMeFieldVisible()) {
ScreenSettingsFacet settingsFacet = UiControllerUtils.getFacet(filter.getFrame(), ScreenSettingsFacet.class);
if (settingsFacet != null) {
saveFilterSettings(settingsFacet, filter.getId(), configurationModel);
}
}
} else {
configurationModel = loadFilterConfigurationModel(filter, configuration.getId());
}
if (configurationModel == null) {
configurationModel = createFilterConfigurationModel(configuration);
}
return configurationModel;
}
Aggregations