on 02-22-2018 4:27 PM
Hi Experts,
We are trying to create a custom control multi-combo box in a smart filter bar where the list of items are dependent from another filter (FilterA). FilterA is also found at the same smart filter bar and with Value help request. So the requirement is whenever FilterA is changed, the drop down list of the multi-combo box changes dynamically.
The problem is that the Value Help GetEntitySet method of the multi-combo box is triggered right away at first launch of the app and no longer calls the same GetEntitySet when FilterA is changed. This leaves the drop down list as empty or will only change values one time.
If anyone knows how to solve this issue, it would be of great help.
Thanks and Best Regards!
Mac
If i have understood your requirement correctly, the value in your multicombox box are actually dependent on value selected by user in Filter A. So you need to pass the value selected by user in Filter A to retrieve the expected values.
Try calling the entityset method of the MultiCombo Box on the filterChange event of the SmartFilterBar whenever you change the value of Filter A. Then you should get the updated values.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks! It worked. Now the the entityset method of the MultiCombo Box is called whenever the value of Filter A is changed.
What happened now is I am getting a "No Data" in my MultiCombo Box. Found out that a 'blank' value of Filter A is passed to the entityset method of the MultiCombo Box. e.g. FilterA EQ ' '. I checked the filter string and select options and all the same having a blank value.
Sharing how we implemented:
filterChange event attached to smartfilterbar object
var oSFB = this.getView().byId("smartFilterBar");
oSFB.attachFilterChange(null, this.fchange, this);
Code for retrieving value from FilterA and passing it to Backend to be used as a where clause for retrieving MultiCombo Box values
fchange: function(oEvent){
var aFilters = [];
var oModel = this.getView().getModel();
if(oEvent.getParameters().getParameters().id.indexOf("FilterA") !== -1){
var FiltrA = oEvent.getParameters().getParameters().value;
aFilters.push(new Filter("FilterA",sap.ui.model.FilterOperator.EQ,FiltrA));
oModel.read(
"/VH_MultiComboBox",
{
filters : aFilters,
success : jQuery.proxy(this.fSuccess, this),
error : jQuery.proxy(this.fErr, this)
},
this);
}
},<br>
Hi Mac,
In the filterChange event, you can directly retrieve the data from the smart filter bar control and pass it to the backend.
if (oEvent.getParameters().getParameter("filterChangeReason") === "FilterA")
{
var filterData = oEvent.getSource().getFilterData();
if (filterData) {
if (filterData.hasOwnProperty("FilterA")) {
var FiltrA = filterData.FilterA;
// Call you combo box service here
}
}
}
User | Count |
---|---|
74 | |
10 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.