Skip to Content
Jun 05 at 10:27 AM

Dynamically setting a value in array SAPUI5

227 Views Last edit Jun 05 at 10:27 AM 2 rev

Hi All,

I am trying to set some data in one of the arrays using the index. If I pass the index value directly (example 0), then the data is set correctly. While if I pass the index value dynamically, as shown below, the data is not set.

In the below 2 examples, the 1st one works correctly, while the 2nd one returns "undefined"-

1. this.getView().getModel("detailView").setProperty("/PermitHdrSet/to_locklinkup/0/LockoutDetSet", tabItems);
2. this.getView().getModel("detailView").setProperty("/PermitHdrSet/to_locklinkup/n/LockoutDetSet", tabItems);