cancel
Showing results for 
Search instead for 
Did you mean: 

Two entityset in a single DataModel. Biding one entity set to table

0 Kudos

Hi ,

I have a scenario

1)i have created a page in UI5 with 4 search help of Vkorg. That vkorg i have to get from gateway service. I have created an entityset(1) and i see my metadata with data populated. How will i bind it , Meta data looks like below.

2) When the user selects a data from above steps , that should be passed to entityset(2) and it should display a output in the ui5.. Basically Here in my getentityset i am using submit program with the parameter obtained from above search help.

is this feasible.??

I have also created association between my two entityset with sales org.

Entityset1 is only sales org

Entityset2 is a structure that has to be displayed when the user selects any sales org.

0 Kudos
What am i missing here?

onSearch: function () {
var oModel = new sap.ui.model.odata.v2.ODataModel("/sap/opu/odata/sap/ZAPI_PRICING_SRV/");
// alert("Hello World!"); // eslint-disable-line no-alert
if (!this._oValueHelpDialog) {
var oInput = this.getView().byId("idSales_org");
this._oValueHelpDialog = new sap.ui.comp.valuehelpdialog.ValueHelpDialog("idValueHelp", {
supportRanges: true,
key: "SALES_ORG",
descriptionKey: "SALES_ORG",
ok: function (oEvt) {
/*var aTokens = oEvt.getParameter("tokens");
oInput.setTokens(aTokens);
this.close();*/
},
cancel: function () {
this.close();
}
});
}
var oTable = new sap.m.Table({
columns: [
new sap.m.Column({
width: "1em",
header: new sap.m.Label({
text: "SalesOrg"
})
})
]
});
var oTemplate = new sap.m.ColumnListItem({
cells: [
new sap.m.Label({
text: "{SaLES_ORG}",
wrapping: false
})
]
});
oTable = this._oValueHelpDialog.getTable();
oTable.setModel(oModel);
oTable.bindItems("/Apiinputset", oTemplate);
this._oValueHelpDialog.addContent(oTable);
this._oValueHelpDialog.open();
}
});

Accepted Solutions (0)

Answers (1)

Answers (1)

geert-janklaps
Active Contributor
0 Kudos

Hi,

Please have a look at following code example of the filterbar component:

https://ui5.sap.com/#/entity/sap.ui.comp.filterbar.FilterBar/sample/sap.ui.comp.sample.filterbar.Dyn...

It demonstrates perfectly how a filter field (in this case a dropdown list) can update the binding of the table and apply a filter to the resultset.

Best regards,

Geert-Jan Klaps