@UiHandler("btnRemove") void removeRecord(ClickEvent e) { InputItem user = selectionModel.getSelectedObject(); if (user != null) { changedRecs.remove(user.getId()); removedRecs.put(user.getId(), user); recordStore.getList().remove(user); editMode(true); } }
private void markChange(InputItem rec) { if (!changedRecs.containsKey(rec.getId())) { changedRecs.put(rec.getId(), rec); if (!separator.isVisible()) { md.info( MDS, "Some data has been changed. Click 'Save' or 'Cancel' when editing is finished."); editMode(true); } dataGrid.redraw(); } }
@UiHandler("btnAdd") void addRecord(ClickEvent e) { InputItem rec = new InputItem(); rec.setName("NEW"); String dt = ClientUtil.TSTAMP_FORMAT0.format(new Date()); rec.setTstart(ClientUtil.parseUnixTime(dt.substring(0, 7) + "-01 09:00:00")); rec.setTstop(ClientUtil.parseUnixTime("2020-01-01 17:00:00")); rec.setActive(1); rec.setTxFormid(0); rec.setInputId(0); rec.setComment(""); recordStore.getList().add(0, rec); changedRecs.put(rec.getId(), rec); editMode(true); }