Custom Editor screen

Hi
I have a screens called Material.browse and Material.edit which is standard screens. I have another AbstractEditor screen for Material entity named materialSourceListEdit. The purpose of this screen is to maintain list of sources (vendors). Is it possible I can using this type of custom named “materialSourceListEdit” screen? I am getting the following error:

java.lang.ClassCastException: com.haulmont.cuba.gui.data.impl.DatasourceImpl cannot be cast to com.haulmont.cuba.gui.data.CollectionDatasource
at com.haulmont.cuba.gui.xml.layout.loaders.FilterLoader.loadComponent(FilterLoader.java:92)
at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponents(ContainerLoader.java:37)
at com.haulmont.cuba.gui.xml.layout.loaders.CssLayoutLoader.loadComponent(CssLayoutLoader.java:53)
at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponents(ContainerLoader.java:37)
at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponentsAndExpand(ContainerLoader.java:89)
at com.haulmont.cuba.gui.xml.layout.loaders.WindowLoader.loadComponent(WindowLoader.java:80)
at com.haulmont.cuba.gui.WindowManager.createWindow(WindowManager.java:575)
at com.haulmont.cuba.gui.WindowManager.openEditor(WindowManager.java:869)
at com.haulmont.cuba.web.WebWindowManager.openEditor(WebWindowManager.java:178)
at com.haulmont.cuba.gui.WindowManager.openEditor(WindowManager.java:837)
at com.haulmont.cuba.gui.components.WindowDelegate.openEditor(WindowDelegate.java:263)
at com.haulmont.cuba.web.gui.WebWindow.openEditor(WebWindow.java:492)
at com.haulmont.cuba.gui.components.AbstractFrame.openEditor(AbstractFrame.java:519)
at com.company.web.proc.materialsourcelist.Materialsourcelist.editSourceList(Materialsourcelist.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl

This is how i have called

public void editSourceList(Component source) {
    Materialsourcelistedit editor = (Materialsourcelistedit) openEditor("materialSourceListEdit", materialsDs.getItem(), WindowManager.OpenType.THIS_TAB);
    editor.addCloseWithCommitListener(() -> {
        // do something
    });
}

Hello, @mortozakhan

It seems that you’ve applied the Filter component to Datasource, while it should be applied to CollectionDatasource.

Regards,
Daniil.

Yes!! thanks. It’s now working.