on 09-19-2015 2:06 PM
Hi All,
I am new to SAP UI5 and having small doubt.
We are showing list using SAP.M.InputListItem in one JS file where we are having data in oBarcodeItemList.
Now at the same list we do have one button on which we open some other JS so now above data is not available.
So we did like this:
Window.findguid = oBarcodeItemList.
Now Window.findguid is available in another JS.
Could you please help me how to get loop on this (Window.findguid) data and search any string (Ex: XYZ) available in this table data or not.
Thanks,
Jaten
Hi Jaten Sangal,
Try JSON Model Concepts.
Ex:
var MyPrevArray = {"name": "Jaten", "Class" : "SAP" };
var JSON = new sap.ui.model.json.JSONModel(MyPrevArray );
this.getView().setModel(JSON,"MyModelName");
//Other End:
sap.m.listItems({
items : {
path : "MyModelName>/",
//Access your record
}
})
Thanks,
Karthik A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use sap.ui.getCore().AppContext(ui5 provided as global variables) instead of window.
sap.ui.getCore().AppContext.Array = your list of values.
i tried,
sap.ui.getCore().AppContext=new Object();
sap.ui.getCore().AppContext.Array = ['dsfdsf','2gereh','3dsfd'];
console.log(sap.ui.getCore().AppContext.Array);
console.log(sap.ui.getCore().AppContext.Array.length);
console.log(sap.ui.getCore().AppContext.Array[0]);
my console is showing,
["dsfdsf", "2gereh", "3dsfd"]
3
dsfdsf
so you can loop it as below,
for(var i=0;i< sap.ui.getCore().AppContext.Array.length;i++)
alert( sap.ui.getCore().AppContext.Array[i]);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.