push in array object replace all values [message #1841099] |
Mon, 03 May 2021 20:24 |
Eclipse User |
|
|
|
Hi, i dont understand because when i excecute push (in onFetch) all values are replace and my array.
ininitialize i have:
importPackage(Packages.java.util.*);
arrayLiq= [];
objfila = new Object();
arrayLiq = [{alix:"xxx",liq:"111"},{alix:"ZZZ",liq:"222"},{alix:"AAA",liq:"333"}]
inonFetch i have:
tamanio=arrayLiq.length;
java.lang.System.out.println("size array >>>:"+tamanio);
objfila.liq = row["liqBob"];
objfila.alix = row["codImp"];
java.lang.System.out.println("datos del objeto auxiliar >>>:"+objfila.liq+objfila.alix);
arrayLiq.push(objfila);
for (z in arrayLiq) {
java.lang.System.out.println("-----"+ arrayLiq[z].liq);
}
but as it goes through the dataset the values are replaced and when I display the complete array from arrayLiq [3] the value is the same.
I work with an XML and birt Version: Neon Release (4.6.0)
i wait your colaboratios. thanks
Rafael
... sorry but my english is bad
|
|
|
Powered by
FUDForum. Page generated in 0.03483 seconds