Skip to Content

Personalization for Dynamically Defined Table

May 01 at 04:27 PM


avatar image

Hi everyone,

I have a custom UI5 app, the main feature is sap.ui.table.Table, which has columns that are defined at run time (with table.addColumn() in the controller, not defined in the XML) based on some user information. I wanted to add a personalization dialog as in this example. What I did differently from the example is that instead of having the oData in the PersoService.js defined statically, I add the column data to it at the same time I add columns to the table.

I am receiving a few errors when I try and open the personalization dialog however (shown below), does anyone have experience adding a personalization dialog for a dynamically defined table? I was not sure from these errors if its just not possible or if I am making a mistake.


capture.png (53.7 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Michael Kassab May 02 at 08:01 PM

Solved: In case anyone has a similar issue - the example on dev guide is for sap.m.TablePersoControllerwhich won't work with sap.ui.table.Columns, there is a sap.ui.table.TablePersoController you can use instead, you will just need to implement the method delPersData instead of resetPersData.

As for using columns that are set dynamically - it looks like you don't even need to set the oData property in the personalization service, I left it as an empty array and it appears to be working fine.

10 |10000 characters needed characters left characters exceeded