on 06-11-2022 9:15 PM
Hi Gurus,
I have two CDS Views entities on backend: C_Parent(key Parent_ID) and C_ParentChild(key Parent_UD, key Child_ID).
On the frontend side I have a <f:GridList>.
I want to get data that returns C_ParentChild and fetch them to the <f:GridList>, based on the filter C_Parent(Parent_ID = Some_ID).
I'm totally new in SAPUI5 and would be grateful for any advice and hints.
At the moment I have the next code:
XML
<f:GridList id="GridListArea" items = { path: '/C_Parent/to_C_ParentChild' }
...
<f:GridList>
Controller
var oBinding = sap.ui.getCore().byId("GridListArea").getBinding("items");
var selectedChilds = this.getView().byId("listReport").getTable().getSelectedContexts();
var selectedParentId = selectedChilds[0].getProperty("Parent_ID");
oBinding.sPath = "/C_Parent('" + selectedParentId + "')/to_C_ParentChild";
Hi, in the grid list., you need a relative path, like
<f:GridList id="GridListArea" items="{to_C_ParentChild}">
...
<f:GridList>
The view must be bound to the parent. For example, this can be done in onRouteMatch
this.getView().bindElement("/C_Parent(parent_id='ABC')")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
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.