-
FEATURED COMPONENTS
First time here? Check out the FAQ!
public void getList() throws ParseException { List data; data = angsuranManager.getAllObjec(Angsuran.class); lstboxdataAngsuran.getItems().clear(); NumberFormat nf = new DecimalFormat("#.##"); int num = 1; tbtnHandler tb = new tbtnHandler(); // tipeKaryawan = vLokM.getViewByQuery("WHERE v.namajenis LIKE '" + "Harian" + "%' GROUP BY v.namajenis"); AngsuranHarianManager AHManager = ServiceLocatorAngsuranHarian.getRefrensiManager(); List dataAngsuran; dataAngsuran = AHManager.getViewByQuery("WHERE v.status LIKE '" + "Lunas" + "%'"); System.out.println("data angsuran=" + dataAngsuran); //jika status angsuran hariannya ada dan lunas if (!dataAngsuran.isEmpty()) { for (Iterator idAng = dataAngsuran.iterator(); idAng.hasNext();) { AngsuranHarian xAng = (AngsuranHarian) idAng.next(); //menampilkan semua data for (Iterator id = data.iterator(); id.hasNext();) { Angsuran rowObj = (Angsuran) id.next(); //jika idangsurannya tidak sama dengan idangsuran diangsuran harian if (rowObj.getIdangsuran() != xAng.getId_Angsuran()) { System.out.println("masuk siniiiiiiiii...."); Listitem item = new Listitem();
Toolbarbutton tbtnEdit = new Toolbarbutton();
tbtnEdit.addEventListener("onClick", tb);
tbtnEdit.setLabel("[Ubah]");
tbtnEdit.setId("edit_" + rowObj.getId_angsuran());
Toolbarbutton tbtnHapus = new Toolbarbutton();
tbtnHapus.addEventListener("onClick", tb);
tbtnHapus.setLabel("[Hapus]");
tbtnHapus.setId("hapus_" + rowObj.getId_angsuran());
Listcell cellitem = new Listcell();
//cellitem.appendChild(tbtnEdit);
cellitem.appendChild(tbtnHapus);
item.setValue(rowObj);
item.appendChild(new Listcell("" + (num++)));
//item.appendChild(new Listcell(rowObj.getId_angsuran() + ""));
item.appendChild(new Listcell(rowObj.getNik_karyawan() + ""));
item.appendChild(new Listcell(rowObj.getJenis_angsuran() + ""));
item.appendChild(new Listcell(rowObj.getTanggal_pinjam() + ""));
item.appendChild(new Listcell(rowObj.getKeterangan() + ""));
item.appendChild(new Listcell(rowObj.getJumlah_pinjaman() + ""));
item.appendChild(cellitem);
======error in lstboxdataAngsuran======== lstboxdataAngsuran.appendChild(item); } }
}
}
else {
for (Iterator id = data.iterator(); id.hasNext();) {
Angsuran rowObj = (Angsuran) id.next();
Listitem item = new Listitem();
Toolbarbutton tbtnEdit = new Toolbarbutton();
tbtnEdit.addEventListener("onClick", tb);
tbtnEdit.setLabel("[Ubah]");
tbtnEdit.setId("edit_" + rowObj.getId_angsuran());
Toolbarbutton tbtnHapus = new Toolbarbutton();
tbtnHapus.addEventListener("onClick", tb);
tbtnHapus.setLabel("[Hapus]");
tbtnHapus.setId("hapus_" + rowObj.getId_angsuran());
Listcell cellitem = new Listcell();
//cellitem.appendChild(tbtnEdit);
cellitem.appendChild(tbtnHapus);
item.setValue(rowObj);
item.appendChild(new Listcell("" + (num++)));
//item.appendChild(new Listcell(rowObj.getId_angsuran() + ""));
item.appendChild(new Listcell(rowObj.getNik_karyawan() + ""));
item.appendChild(new Listcell(rowObj.getJenis_angsuran() + ""));
item.appendChild(new Listcell(rowObj.getTanggal_pinjam() + ""));
item.appendChild(new Listcell(rowObj.getKeterangan() + ""));
item.appendChild(new Listcell(rowObj.getJumlah_pinjaman() + ""));
item.appendChild(cellitem);
lstbox_dataAngsuran.appendChild(item);
}
}
can somebody help me??please..
Hello jwasky,
From the provided code sample, and the error message you have to ensure that the provided id's are unique.
This can be accomplished by adding log files, and debugging the application.
Furthermore for more information please refer to the following url:
http://books.zkoss.org/wiki/ZKDeveloper%27sReference/UIComposing/IDSpace
Finally if it is possible please post the whole code of the page.
Best Regards,
Darksu
Asked: 2014-12-11 01:36:41 +0800
Seen: 12 times
Last updated: Dec 14 '14