I'm trying to get a filterBuilder ( associated datasource defined in .ds.xml file) to populate a field options list from a datasource.
Can you point me to an example of this ?
I'm pretty sure I'm doing something wrong but cant find a good example.
My attempt - Source code fragment is ( copied by hand so may have types but you get the idea )
// get filter builder and option data sources
DataSource ds1 = DataSource.get("ds1");
DataSource dsOptions = DataSource.get("myOptionsDS");
// get field to add options
DataSourceField dsf = ds1.getField("field1");
// create options combo box editor and configure for options data source
ComboBoxItem cbi = new ComboBoxItem();
cb.setOptionsDataSource(dsOptions);
cb.setShowOptionsFromDataSource(true);
// set editor ( combo box) on data source fields
dsf.setEditorType(cbi);
FilterBuilder fb = new FilterBuilder();
When the filterBuilder is displayed the option field is not populated, looking at the console it looks like the query is going against the ds1 data source not the dsOptions data source
Thanks
Can you point me to an example of this ?
I'm pretty sure I'm doing something wrong but cant find a good example.
My attempt - Source code fragment is ( copied by hand so may have types but you get the idea )
// get filter builder and option data sources
DataSource ds1 = DataSource.get("ds1");
DataSource dsOptions = DataSource.get("myOptionsDS");
// get field to add options
DataSourceField dsf = ds1.getField("field1");
// create options combo box editor and configure for options data source
ComboBoxItem cbi = new ComboBoxItem();
cb.setOptionsDataSource(dsOptions);
cb.setShowOptionsFromDataSource(true);
// set editor ( combo box) on data source fields
dsf.setEditorType(cbi);
FilterBuilder fb = new FilterBuilder();
When the filterBuilder is displayed the option field is not populated, looking at the console it looks like the query is going against the ds1 data source not the dsOptions data source
Thanks
Comment