Hi, I created data source in xml file and one filter with that data source. I am removing the items from datasource and adding new Items in controller. I want the new items added into the datasource should be add into the filter as well. But still filter pointing the old items of data source. Plz find the codes.
Below is the xml file code for datasource and filter
<groupDatasource id="plan_DatasDs"
class="com.keansa.keansacloud.entity.Plan_Data"
view="plan_Data-with-MDPLANUnits-MDMEASURE">
<query>
<![CDATA[select e from keansacloud$Plan_Data e
]]>
<filter id="filter"
applyTo="planDataGrid"
datasource="plan_DatasDs">
<properties include=".*"/>
</filter>
Below is the controller code.
public void createDataForDataAccordingToGroupByForDataGrid(){
LoadContext<Plan_Data> loadContext = LoadContext.create(Plan_Data.class)
.setQuery(LoadContext.createQuery("select e from abs$Plan_Data e"));
loadContext.setView("plan");
List<Plan_Data> planningViewList = dataManager.loadList(loadContext);
for (Plan_Data plan_data:planningViewList){
plan_DatasDs.removeItem(plan_data);
filter_DatasDs.removeItem(plan_data);
}
List<Plan_Data> planningviewList = planningViewService.getPlanningViewListForAllPlanningViews("someValue1","someValue2");
for(Plan_Data planData:planningviewList){
plan_DatasDs.addItem(planData);
filter_DatasDs.includeItem(planData);
}
}