Showing results for 
Search instead for 
Did you mean: 

How to put Objects from Table into an Array

Former Member
0 Kudos

Hi Guys,

We have objects/Items in our main view (screenshot nr.1). How Can I put these into an array?

var remainingItems = [];

remainingItems = remainingItems.this.byId("table").getItems();

if (remainingItems.length > 0){

var odialog1 = new sap.m.Dialog({ title: 'Achtung', type: 'Message', content: [ new sap.m.Label({ text: 'Noch X Tickets sind nicht erfasst! Fehler: XXX' }) ],

this is just a part of the code

It doesnt work!

I want to count, if there are objects in the view, then it should appear a Popup.

I hope you can help me.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

try doing these steps, it could work...

  1. give objects id like obj1,obj2...
  2. run a for loop for(i=1;i<=maxno;i++) and in each this.getView().byId("<obj(i)>").getText() check if the value is null or not if null set flag to 1 and end loop.
  3. if flag is still 0 then all the objects have text in them.
  4. and then raise the popover