private boolean validate(FormDeletion data) { List<String> errors = data.validate(); if (errors != null) { String textError = "Silahkan koreksi Error berikut untuk melanjutkan : </br>"; for (String error : errors) { textError = textError + error + "</br>"; } showError(ErrorLabel.GENERAL, textError); return false; } return true; }
@Override public FormDeletion getFormData() { FormDeletion form = new FormDeletion(function); form.setDeletionDate(inputDeletionDate.getValue()); form.setInformation(information.getValue()); form.setQuantity(inputGoodsQuantity.getValue()); form.setIdGoods((String) inputGoodsSelect.getValue()); form.setDeletionId(this.deletionId); form.setPrice(inputGoodsPrice.getValue()); return form; }
// MEngeset data dari FormData ke form private void setData(FormDeletion data) { // untuk kebutuhan edit inputDeletionDate.setValue(data.getDeletionDate()); information.setValue(data.getInformation()); inputGoodsQuantity.setValue(data.getQuantity()); inputGoodsSelect.setValue(data.getIdGoods()); this.deletionId = data.getDeletionId(); inputGoodsPrice.setValue(data.getPrice()); }
private FormDeletion getFormData(FormDeletion form) { form.setDeletionDate(inputDeletionDate.getValue()); form.setInformation(information.getValue()); form.setQuantity(inputGoodsQuantity.getValue()); form.setIdGoods((String) inputGoodsSelect.getValue()); form.setDeletionId(this.deletionId); form.setPrice(inputGoodsPrice.getValue()); return form; }