0

org.zkoss.zk.ui.UiException: Not unique in the ID space of <AngsuranWND winAngsuran>: hapus_1

asked 2014-12-11 01:36:41 +0800

jwasky gravatar image jwasky
11 3

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..

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-12-14 09:27:49 +0800

Darksu gravatar image Darksu
1991 1 4

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

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-12-11 01:36:41 +0800

Seen: 12 times

Last updated: Dec 14 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More