I have a SAPUI5 Table which has aggregation 'items' bound to the 'Expenses' entity of my OData.
'Expenses' is a part of the main Entity 'Claim', there is an Association in the OData between them. I am using the $expand command in the call to get the main ClaimSet with the expanded entity inside.
<Table items={odata>Expenses} ...
I have a Delete button in each row I want to hide if the main entity 'Claim' has the flag 'submitted: true'. This is now a read only entry so the button should not be shown.
The FlexibleColumnLayout page I'm using is bound to the odata ClaimSet.
var oView = this.getView().byId("ObjectPageLayout");
...
oView.bindElement({
path: "/" + sObjectPath, //looks like: /ClaimSet('12345')
model: "odata"
});
I cannot use visible="{odata>Submitted}" for the button, as 'odata>' is now referring to the Expenses entity, not the Claim entity. I am able to access Claim outside of the table, for example a the top of the view in the header section.
How can I access the main Claim entity inside the context of the Expense entity? Is there a way of doing this without creating a separate jsonmodel? I'd like to keep it inside the XML if possible.