on 08-03-2023 6:07 PM
Hi,
I am trying to attach an event to a Facet after the Table is loaded.
Tried using onAfterHandler in Object Page Extension API. I am not able to get the Control details using below statement.
sap.ui.getCore().byId('awa.dom.ui.docketing::IncomingCorrespondenceObjectPage--fe::table::allContent::LineItem-innerTable')
I am able to reach only till LineItem as below.
sap.ui.getCore().byId('awa.dom.ui.docketing::IncomingCorrespondenceObjectPage--fe::table::allContent::LineItem')
I will not be able to attach my custom event to LineItem. I need a way to attach it to innerTable.
Can you let me know how can I do this. Looking for something similar to below documentation which is applicable only to oData v2.
https://sapui5.hana.ondemand.com/#/topic/382a6c39fd494c12a4ee23c8659909bd.
The getRowBinding() method gives you a list binding for which there is an attachRefresh() available. In order to get the row binding, the table data needs to be loaded, so the implementation looks something like this:
// Use up to 'LineItem::xyz' for the ID
const table = this.getView().byId('your-table-id');
table.addDelegate({
onAfterRendering: function () {
if (table.getRowBinding()) {
table.getRowBinding().attachRefresh((e) => {
// logic here
// you can access e.getParameter('reason') for more information about the event, I think it also runs when the page is loaded
);
}
}
})
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Danielle,
It worked. I was able to add my logic within Table onAfterRendering.
User | Count |
---|---|
78 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.