Passing datasource through params to table of opened window

Previous versions of platform allowed me to pass datasource through params and set it to table component in “init” method, but now I don’t have this ability because of throwing exception: (UnsupportedOperationException(“Changing datasource is not supported by the Table component”):wink: .
As a workaround I overriden DsContextImpl.get(String id) as :


@Override
public Datasource get(String id) { 
    Datasource ds = super.get(id); 
     if(windowContext != null && ds == null) {
        Object dsCandidate = windowContext.getParams().get(id); 
        if(dsCandidate instanceof Datasource) { 
            ds = (Datasource) dsCandidate;
        }
    }
    return ds;
}

Is there any other way to set datasource to the table from window params without this hack?

Hi,

We are going to implement normal data source changing mechanism in this issue https://youtrack.cubba-platform.com/issue/PL-9133 It will be available in the next minor release 6.6

In fact, Table throws UnsupportedOperationException because it has a couple of really mad bugs with detaching of previously set data source. We’ve decided to clearly show its problems with UnsupportedOperationException, to prevent memory leaks and bugs that can be caused by buggy Table implementation. In release 6.6 we will fix it and you will be able to change data source of a Table.