Hi, I'm using v9.1p_2015-04-18/PowerEdition Deployment 2015-04-18, the problem explained below occurs within Chrome (Version 46.0.2490.71 m) and Firefox (41.0.2).
I have a DataSource defined as following:
I add data via
the "lotsOfItems" are around 200, I verified that on my end the primary key is unique and added only once. When I view the data and inspect the list I see duplicates, to be sure I sort by occ(urrences) and I again see that I have two entries with the same ID (primary key).
I also verified that no ID is added twice (as shown in the code snippet).
Did I miss something when defining the DataSource?
Do I have to set some property for ListGrid?
Anyhow, I'm very confused how it's possible to have two entries with the same primary key.
Any hints and help is very much appreciated. Thanks in advance.
I have a DataSource defined as following:
Code:
public OverviewDs() { setID("blaid"); DataSourceIntegerField mid = new DataSourceIntegerField("id", "id"); mid.setRequired(true); mid.setPrimaryKey(true); mid.setCanEdit(false); mid.setHidden(true); DataSourceTextField identity = new DataSourceTextField("iden", "iden"); identity.setRequired(true); identity.setCanEdit(false); identity.setHidden(false); DataSourceIntegerField occ = new DataSourceIntegerField("occ", "occ"); occ.setRequired(true); occ.setCanEdit(false); occ.setHidden(false); setFields(mid, identity, occ); setClientOnly(true); }
Code:
ListGrid myListGrid = new ListGrid(); myListGrid.setAutoFetchData(false); DataSource ds = new OverviewDs(); int count = 0; for (Items i : lotsOfItems) { count++; // create ListGridRecord with id set to count ds.addData(generatedListGridRecord); } myListGrid.setDataSource(ds); myListGrid.fetchData();
I also verified that no ID is added twice (as shown in the code snippet).
Did I miss something when defining the DataSource?
Do I have to set some property for ListGrid?
Anyhow, I'm very confused how it's possible to have two entries with the same primary key.
Any hints and help is very much appreciated. Thanks in advance.
Comment