List of usage examples for com.vaadin.ui TextField getValue
@Override
public String getValue()
From source file:com.mycollab.vaadin.web.ui.MailFormWindow.java
License:Open Source License
private void initUI() { GridLayout mainLayout = new GridLayout(1, 5); mainLayout.setWidth("100%"); mainLayout.setMargin(true);/*from www . ja v a 2 s.c om*/ mainLayout.setSpacing(true); CssLayout inputPanel = new CssLayout(); inputPanel.setWidth("100%"); inputPanel.setStyleName("mail-panel"); inputLayout = new GridLayout(3, 4); inputLayout.setSpacing(true); inputLayout.setWidth("100%"); inputLayout.setColumnExpandRatio(0, 1.0f); inputPanel.addComponent(inputLayout); mainLayout.addComponent(inputPanel); tokenFieldMailTo = new EmailTokenField(); inputLayout.addComponent(createTextFieldMail("To:", tokenFieldMailTo), 0, 0); if (lstMail != null) { for (String mail : lstMail) { if (StringUtils.isNotBlank(mail)) { if (mail.indexOf("<") > -1) { String strMail = mail.substring(mail.indexOf("<") + 1, mail.lastIndexOf(">")); if (strMail != null && !strMail.equalsIgnoreCase("null")) { } } else { } } } } final TextField subject = new TextField(); subject.setRequired(true); subject.setWidth("100%"); subjectField = createTextFieldMail("Subject:", subject); inputLayout.addComponent(subjectField, 0, 1); initButtonLinkCcBcc(); ccField = createTextFieldMail("Cc:", tokenFieldMailCc); bccField = createTextFieldMail("Bcc:", tokenFieldMailBcc); final RichTextArea noteArea = new RichTextArea(); noteArea.setWidth("100%"); noteArea.setHeight("200px"); mainLayout.addComponent(noteArea, 0, 1); mainLayout.setComponentAlignment(noteArea, Alignment.MIDDLE_CENTER); final AttachmentPanel attachments = new AttachmentPanel(); attachments.setWidth("500px"); MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close()).withStyleName(WebThemes.BUTTON_OPTION); MButton sendBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.ACTION_SEND_EMAIL), clickEvent -> { if (tokenFieldMailTo.getListRecipient().size() <= 0 || subject.getValue().equals("")) { NotificationUtil.showErrorNotification( "To Email field and Subject field must be not empty! Please fulfil them before sending email."); return; } if (UserUIContext.getUser().getEmail() != null && UserUIContext.getUser().getEmail().length() > 0) { ExtMailService systemMailService = AppContextUtil.getSpringBean(ExtMailService.class); List<File> listFile = attachments.files(); List<AttachmentSource> attachmentSource = null; if (listFile != null && listFile.size() > 0) { attachmentSource = new ArrayList<>(); for (File file : listFile) { attachmentSource.add(new FileAttachmentSource(file)); } } systemMailService.sendHTMLMail(UserUIContext.getUser().getEmail(), UserUIContext.getUser().getDisplayName(), tokenFieldMailTo.getListRecipient(), tokenFieldMailCc.getListRecipient(), tokenFieldMailBcc.getListRecipient(), subject.getValue(), noteArea.getValue(), attachmentSource, true); close(); } else { NotificationUtil .showErrorNotification("Your email is empty value, please fulfil it before sending email!"); } }).withIcon(FontAwesome.SEND).withStyleName(WebThemes.BUTTON_ACTION); MHorizontalLayout controlsLayout = new MHorizontalLayout(attachments, cancelBtn, sendBtn) .expand(attachments).withFullWidth(); mainLayout.addComponent(controlsLayout, 0, 2); this.setContent(mainLayout); }
From source file:com.mymita.vaadlets.demo.AddonDemoApplication.java
License:Apache License
@Override public void init() { try {//from ww w . j av a 2s . c o m final VaadletsBuilder vaadletsBuilder = VaadletsBuilder.build(new InputStreamReader( new ClassPathResource("demo.xml", AddonDemoApplication.class).getInputStream())); final Window root = (Window) vaadletsBuilder.getRoot(); setMainWindow(root); setTheme("vaadlets"); final Button testButton = vaadletsBuilder.getComponent("test"); testButton.addListener(new ClickListener() { @Override public void buttonClick(final ClickEvent event) { final Panel content = vaadletsBuilder.getComponent("content"); final TextField editor = vaadletsBuilder.getComponent("editor"); content.getContent().removeAllComponents(); try { final VaadletsBuilder v = VaadletsBuilder .build(CharStreams.newReaderSupplier((String) editor.getValue()).getInput()); if (v.getRoot() instanceof Window) { final Window w = (Window) v.getRoot(); root.addWindow(w); } else { content.getContent().addComponent(v.getRoot()); } } catch (final Exception e) { LOG.error("error", e); content.addComponent(createStackTraceLabel(e)); } } }); final Button resetButton = vaadletsBuilder.getComponent("reset"); resetButton.addListener(new ClickListener() { @Override public void buttonClick(final ClickEvent event) { fillEditorWithDefaultXML(vaadletsBuilder); } }); fillEditorWithDefaultXML(vaadletsBuilder); } catch (final IOException e) { } }
From source file:com.neatresults.mgnltweaks.neatu2b.ui.form.field.U2BField.java
License:Open Source License
/** * Initialize the field. <br>//from w ww . j a v a2s .c o m * Create as many configured Field as we have related values already stored. */ @Override protected void initFields(final PropertysetItem newValue) { root.removeAllComponents(); final TextField id = createTextField("Id", newValue); root.addComponent(id); final TextField title = createTextField("Title", newValue); root.addComponent(title); final TextFieldDefinition def = new TextFieldBuilder("description").label("Description").rows(3) .definition(); final TextArea description = (TextArea) createLocalField(def, newValue.getItemProperty(def.getName()), false); newValue.addItemProperty(def.getName(), description.getPropertyDataSource()); description.setNullRepresentation(""); description.setWidth("100%"); description.setNullSettingAllowed(true); root.addComponent(description); HorizontalLayout ddLine = new HorizontalLayout(); final TextField publishedAt = createTextField("Published", newValue); ddLine.addComponent(publishedAt); final TextField duration = createTextField("Duration", newValue); ddLine.addComponent(duration); ddLine.addComponent(createTextField("Definition", newValue)); Button fetchButton = new Button("Fetch metadata"); fetchButton.addStyleName("magnoliabutton"); fetchButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { String idStr = id.getValue(); // extract id from url when whole url is passed if (idStr.startsWith("http")) { idStr = StringUtils.substringBefore(StringUtils.substringAfter(idStr, "?v="), "&"); } U2BService service = null; try { RestEasyClient client = (RestEasyClient) restClientRegistry.getRestClient("youtube"); service = client.getClientService(U2BService.class); } catch (RegistrationException e) { log.error("Failed to get a client for [" + U2BService.class.getName() + "] with: " + e.getMessage(), e); } if (service != null) { String key = u2bModule.getGoogleKey(); JsonNode response = service.meta(idStr, "snippet", key); try { if (response.get("items").getElements().hasNext()) { JsonNode videoItem = response.get("items").getElements().next(); String descriptionStr = videoItem.get("snippet").get("description").getTextValue(); newValue.getItemProperty("description").setValue(descriptionStr); String titleStr = videoItem.get("snippet").get("title").getTextValue(); newValue.getItemProperty("title").setValue(titleStr); Iterator<Entry<String, JsonNode>> thumbs = videoItem.get("snippet").get("thumbnails") .getFields(); while (thumbs.hasNext()) { Entry<String, JsonNode> entry = thumbs.next(); newValue.getItemProperty(entry.getKey() + "Url") .setValue(entry.getValue().get("url").getTextValue()); newValue.getItemProperty(entry.getKey() + "Width") .setValue("" + entry.getValue().get("width").getLongValue()); newValue.getItemProperty(entry.getKey() + "Height") .setValue("" + entry.getValue().get("height").getLongValue()); } String publishedAtStr = videoItem.get("snippet").get("publishedAt").getTextValue(); newValue.getItemProperty("published").setValue(publishedAtStr); } } catch (Exception e) { log.error("Failed to parse the video metadata.", e); } response = service.meta(idStr, "contentDetails", key); try { if (response.get("items").getElements().hasNext()) { JsonNode videoItem = response.get("items").getElements().next(); String durationStr = videoItem.get("contentDetails").get("duration").getTextValue(); newValue.getItemProperty("duration").setValue(durationStr); String definition = videoItem.get("contentDetails").get("definition").getTextValue(); newValue.getItemProperty("definition").setValue(definition); } } catch (Exception e) { log.error("Failed to parse the video duration.", e); } } } }); ddLine.addComponent(fetchButton); ddLine.setWidth(100, Unit.PERCENTAGE); ddLine.setHeight(-1, Unit.PIXELS); ddLine.setComponentAlignment(fetchButton, Alignment.BOTTOM_RIGHT); root.addComponent(ddLine); PropertysetItem item = (PropertysetItem) getPropertyDataSource().getValue(); root.addComponent(createEntryComponent("default", item), root.getComponentCount() - 1); root.addComponent(createEntryComponent("standard", item), root.getComponentCount() - 1); root.addComponent(createEntryComponent("medium", item), root.getComponentCount() - 1); root.addComponent(createEntryComponent("high", item), root.getComponentCount() - 1); root.addComponent(createEntryComponent("maxres", item), root.getComponentCount() - 1); }
From source file:com.nfl.dm.clubsites.cms.articles.subapp.articleeditor.tagging.TaggingViewImpl.java
License:Open Source License
private void addCustomTag(final TextField newTagTextField) { listener.onTagCreated(newTagTextField.getValue()); newTagTextField.setValue(null);//from w ww.jav a2 s. c o m }
From source file:com.oodrive.nuage.webui.component.DeviceItemComponent.java
License:Apache License
/** * Create the component to take a snapshot. * //from ww w . j a v a 2 s. c o m * @return the component */ @SuppressWarnings("serial") private final AbstractComponent createTakeSnap() { final VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setMargin(true); final FormLayout takeSnapLayout = new FormLayout(); takeSnapLayout.setMargin(true); takeSnapLayout.setImmediate(true); takeSnapLayout.setWidth(null); layout.addComponent(takeSnapLayout); layout.setComponentAlignment(takeSnapLayout, Alignment.MIDDLE_CENTER); // Enter name final TextField vvrName = new TextField("Name", ""); takeSnapLayout.addComponent(vvrName); // take button final Button take = new Button("Take snapshot"); layout.addComponent(take); layout.setComponentAlignment(take, Alignment.MIDDLE_CENTER); take.addClickListener(new Button.ClickListener() { @Override public void buttonClick(final ClickEvent event) { try { model.takeDeviceSnapshot(vvrName.getValue()); Notification.show("New snapshot created", Notification.Type.TRAY_NOTIFICATION); } catch (final Exception e) { final ErrorWindow err = new ErrorWindow("Snapshot not taken: " + e.getMessage()); err.add(model); } } }); return layout; }
From source file:com.oodrive.nuage.webui.component.SnapshotItemComponent.java
License:Apache License
/** * Create the component to create a device. * //from w w w .ja va 2s.c o m * @return the component */ @SuppressWarnings("serial") private final AbstractComponent createDevice() { final VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); layout.setSpacing(true); final FormLayout createDeviceLayout = new FormLayout(); createDeviceLayout.setMargin(true); createDeviceLayout.setWidth(null); createDeviceLayout.setImmediate(true); layout.addComponent(createDeviceLayout); layout.setComponentAlignment(createDeviceLayout, Alignment.MIDDLE_CENTER); // Enter name final TextField deviceName = new TextField("Name", ""); createDeviceLayout.addComponent(deviceName); // Enter size final TextField deviceSize = new TextField("Size", ""); createDeviceLayout.addComponent(deviceSize); // Create button final Button create = new Button("Create device"); layout.addComponent(create); layout.setComponentAlignment(create, Alignment.MIDDLE_CENTER); create.addClickListener(new Button.ClickListener() { @Override public void buttonClick(final ClickEvent event) { try { model.createDevice(deviceName.getValue(), Long.valueOf(deviceSize.getValue())); Notification.show("New device created", Notification.Type.TRAY_NOTIFICATION); } catch (final NumberFormatException e) { final ErrorWindow err = new ErrorWindow("Size must be a valid number"); err.add(model); } catch (final Exception e) { final ErrorWindow err = new ErrorWindow("Device not created: " + e.getMessage()); err.add(model); } } }); return layout; }
From source file:com.oodrive.nuage.webui.component.window.VvrAttributesWindow.java
License:Apache License
@SuppressWarnings("serial") @Override//from ww w. j a v a 2 s . c om public final Window init(final AbstractItemModel model) { // Cast model in vvrModel final VvrModel vvrModel = (VvrModel) model; // Add new window final Window vvrAttributesWindow = new Window("VVR Attributes"); vvrAttributesWindow.center(); vvrAttributesWindow.setWidth("400px"); vvrAttributesWindow.setResizable(false); final VerticalLayout layout = new VerticalLayout(); vvrAttributesWindow.setContent(layout); layout.setMargin(true); final FormLayout vvrAttributesLayout = new FormLayout(); layout.addComponent(vvrAttributesLayout); vvrAttributesLayout.setMargin(true); // Enter NAME String value = vvrModel.getVvrName(); if (value == null) { value = ""; } final TextField name = new TextField("Name", value); name.setSizeFull(); vvrAttributesLayout.addComponent(name); // Enter description value = vvrModel.getVvrDescription(); if (value == null) { value = ""; } final TextField desc = new TextField("Description", value); desc.setSizeFull(); vvrAttributesLayout.addComponent(desc); // Enter name final TextField vvrUUID = new TextField("UUID"); vvrUUID.setValue(vvrUuid.toString()); vvrUUID.setReadOnly(true); vvrUUID.setSizeFull(); vvrAttributesLayout.addComponent(vvrUUID); // OK button final HorizontalLayout hzlayout = new HorizontalLayout(); layout.addComponent(hzlayout); hzlayout.setSizeFull(); final Button okButton = new Button("OK"); hzlayout.addComponent(okButton); hzlayout.setComponentAlignment(okButton, Alignment.MIDDLE_CENTER); okButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(final ClickEvent event) { WaitingComponent.executeBackground(vvrModel, new Background() { @Override public void processing() { vvrModel.setVvrName(name.getValue()); vvrModel.setVvrDescription(desc.getValue()); } @Override public void postProcessing() { } }); vvrAttributesWindow.close(); } }); // Cancel button final Button cancelButton = new Button("Cancel"); hzlayout.addComponent(cancelButton); hzlayout.setComponentAlignment(cancelButton, Alignment.MIDDLE_CENTER); cancelButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(final ClickEvent event) { // Just close the window vvrAttributesWindow.close(); } }); return vvrAttributesWindow; }
From source file:com.oodrive.nuage.webui.component.window.VvrCreateWindow.java
License:Apache License
@SuppressWarnings("serial") @Override/*from w ww. j av a2 s . c o m*/ public final Window init(final AbstractItemModel model) { // Add new window vvrCreateWindow.center(); final FormLayout vvrCreateLayout = new FormLayout(); vvrCreateLayout.setMargin(true); vvrCreateWindow.setContent(vvrCreateLayout); vvrCreateWindow.setResizable(false); vvrCreateWindow.setClosable(false); // Enter name final TextField vvrName = new TextField("Name"); vvrName.setValue(""); vvrCreateLayout.addComponent(vvrName); // Enter decription final TextField vvrDescription = new TextField("Description"); vvrDescription.setValue(""); vvrCreateLayout.addComponent(vvrDescription); // Button create final Button vvrCreateButton = new Button("Create"); vvrCreateLayout.addComponent(vvrCreateButton); vvrCreateButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(final ClickEvent event) { try { ((VvrManagerModel) model).createVvr(vvrName.getValue(), vvrDescription.getValue()); Notification.show("New VVR created", Notification.Type.TRAY_NOTIFICATION); postProcessing.execute(); } catch (final Exception e) { final ErrorWindow err = new ErrorWindow("VVR not created: " + e.getMessage()); err.add(model); } } }); return vvrCreateWindow; }
From source file:com.openhris.employee.NewEmployeeWindow.java
public NewEmployeeWindow(String employeeId) { this.employeeId = employeeId; setCaption("New Employee"); setWidth("535px"); errorLabel.setVisible(false);/*from w w w. j av a 2 s . com*/ GridLayout grid = new GridLayout(3, 9); grid.setSpacing(true); grid.setSizeFull(); final TextField firstname = new HRISTextField("Firstname:"); grid.addComponent(firstname, 0, 0); final TextField middlename = new HRISTextField("Middlename:"); grid.addComponent(middlename, 1, 0); final TextField lastname = new HRISTextField("Lastname:"); grid.addComponent(lastname, 2, 0); corporation = dropDown.populateCorporateComboBox(new ComboBox()); grid.addComponent(corporation, 0, 1, 1, 1); final PopupDateField entryDate = new HRISPopupDateField("Entry Date:"); grid.addComponent(entryDate, 2, 1); trade = new ComboBox("Trade: "); trade.setWidth("100%"); corporation.addListener(corporateListener); grid.addComponent(trade, 0, 2, 1, 2); final ComboBox dependent = dropDown.populateTotalDependent("Employee's Dependent"); grid.addComponent(dependent, 2, 2); branch = new ComboBox("Branch: "); branch.setWidth("100%"); trade.addListener(tradeListener); branch.addListener(branchListener); grid.addComponent(branch, 0, 3, 1, 3); final TextField department = new HRISTextField("Department: "); grid.addComponent(department, 2, 3); final TextField position = new HRISTextField("Position: "); grid.addComponent(position, 0, 4); final TextField sssNo = new HRISTextField("SSS #:"); grid.addComponent(sssNo, 1, 4); final TextField hdmfNo = new HRISTextField("HDMF #: "); grid.addComponent(hdmfNo, 2, 4); final ComboBox employmentStatus = dropDown.populateEmploymentStatus("Employment Status: "); grid.addComponent(employmentStatus, 0, 5); final TextField tinNo = new HRISTextField("Tin #:"); grid.addComponent(tinNo, 1, 5); final TextField peicNo = new HRISTextField("Philhealth #"); grid.addComponent(peicNo, 2, 5); final TextField employmentWage = new HRISTextField("Employment Wage: "); employmentWage.setValue("0.0"); employmentWage.addListener(checkEntryIfDoubleListener); grid.addComponent(employmentWage, 0, 6); final ComboBox employmentWageStatus = dropDown.populateEmploymentWageStatus("Employment Wage Status: "); grid.addComponent(employmentWageStatus, 1, 6); final ComboBox employmentWageEntry = dropDown.populateEmploymentWageEntry("Employment Wage Entry: "); grid.addComponent(employmentWageEntry, 2, 6); Button saveButton = new Button("SAVE NEW EMPLOYEE"); saveButton.setWidth("100%"); saveButton.addListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { boolean resultQueryInsert, result1, result2, checkId; boolean checkResultForDuplicate; result1 = utilities.checkInputIfDouble(employmentWage.getValue().toString().trim()); if (corporation.getValue() == null) { getWindow().showNotification("Select Corporation!", Window.Notification.TYPE_ERROR_MESSAGE); return; } if (trade.getValue() == null) { getWindow().showNotification("Select Trade!", Window.Notification.TYPE_ERROR_MESSAGE); return; } if (branch.getValue() == null) { getWindow().showNotification("Select Branch!", Window.Notification.TYPE_ERROR_MESSAGE); return; } if (dependent.getValue() == null) { getWindow().showNotification("Select # of dependent!", Window.Notification.TYPE_ERROR_MESSAGE); return; } if (employmentStatus.getValue() == null) { getWindow().showNotification("Select Employment Status!", Window.Notification.TYPE_ERROR_MESSAGE); return; } if (employmentWageStatus.getValue() == null) { getWindow().showNotification("Select Employment Wage Status!", Window.Notification.TYPE_ERROR_MESSAGE); return; } if (employmentWageEntry.getValue() == null) { getWindow().showNotification("Select Employment Wage Entry!", Window.Notification.TYPE_ERROR_MESSAGE); return; } if (department.getValue() == null) { getWindow().showNotification("Select Department!", Window.Notification.TYPE_ERROR_MESSAGE); return; } if (result1 == false) { getWindow().showNotification("Invalid Input for EmploymentWage/EmploymentAllowanceEntry", Window.Notification.TYPE_ERROR_MESSAGE); return; } checkResultForDuplicate = employeeService.checkForDuplicateEmployee( firstname.getValue().toString().trim().toLowerCase(), middlename.getValue().toString().trim().toLowerCase(), lastname.getValue().toString().trim().toLowerCase()); if (checkResultForDuplicate) { try { errorLabel.setVisible(true); } catch (Exception e) { e.printStackTrace(System.out); } return; } int corporate_id = companyService.getCorporateId(corporation.getValue().toString()); int trade_id = companyService.getTradeId(trade.getValue().toString(), getCorporateId()); int branch_id = companyService.getBranchId(getTradeId(), branch.getValue().toString()); PostEmploymentInformationBean pe = new PostEmploymentInformationBean(); pe.setFirstname(firstname.getValue().toString().trim()); pe.setMiddlename(middlename.getValue().toString().trim()); pe.setLastname(lastname.getValue().toString().trim()); pe.setCompany(corporation.getValue().toString()); pe.setTrade(trade.getValue().toString()); pe.setBranch(branch.getValue().toString()); pe.setBranchId(branch_id); pe.setDepartment(department.getValue().toString().trim()); pe.setTotalDependent(dependent.getItem(dependent.getValue()).toString()); pe.setPosition(position.getValue().toString().trim()); pe.setEntryDate( utilities.parsingDate(utilities.convertDateFormat(entryDate.getValue().toString()))); pe.setSssNo(sssNo.getValue().toString().trim()); pe.setTinNo(tinNo.getValue().toString().trim()); pe.setPhicNo(peicNo.getValue().toString().trim()); pe.setHdmfNo(hdmfNo.getValue().toString().trim()); pe.setEmploymentStatus(employmentStatus.getItem(employmentStatus.getValue()).toString()); pe.setEmploymentWageStatus( employmentWageStatus.getItem(employmentWageStatus.getValue()).toString()); pe.setEmploymentWageEntry(employmentWageEntry.getItem(employmentWageEntry.getValue()).toString()); pe.setEmploymentWage(utilities.convertStringToDouble(employmentWage.getValue().toString().trim())); resultQueryInsert = employeeService.insertNewEmployee(pe); if (resultQueryInsert == true) { close(); } else { getWindow().showNotification("SQL ERROR!"); } } }); grid.addComponent(saveButton, 1, 7, 2, 7); grid.addComponent(errorLabel, 1, 8, 2, 8); addComponent(grid); }
From source file:com.openhris.payroll.AdjustmentWindow.java
public AdjustmentWindow(int payrollId, double amountToBeReceive, double amountReceived, double adjustment) { this.payrollId = payrollId; this.amountToBeReceive = amountToBeReceive; this.amountReceived = amountReceived; this.adjustment = adjustment; setCaption("ADJUSTMENTS"); setWidth("400px"); TabSheet ts = new TabSheet(); ts.addStyleName("bar"); VerticalLayout vlayout = new VerticalLayout(); vlayout.setMargin(true);//from www . j av a2s .co m vlayout.setSpacing(true); vlayout.setCaption("Post Adjustments"); final TextField amount = new TextField("Amount: "); amount.setWidth("100%"); vlayout.addComponent(amount); final TextField remarks = new TextField("Remarks"); remarks.setWidth("100%"); vlayout.addComponent(remarks); Button saveAdjustments = new Button("POST ADJUSTMENTS"); saveAdjustments.setWidth("100%"); saveAdjustments.addListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { if (amount.getValue() == null || amount.getValue().toString().trim().isEmpty()) { getWindow().showNotification("Enter Amount for adjustment.", Window.Notification.TYPE_WARNING_MESSAGE); return; } else { if (!utilities.checkInputIfDouble(amount.getValue().toString().trim())) { getWindow().showNotification("Enter a numeric value for amount.", Window.Notification.TYPE_ERROR_MESSAGE); return; } } if (remarks.getValue() == null || remarks.getValue().toString().trim().isEmpty()) { getWindow().showNotification("Add remarks for adjustment.", Window.Notification.TYPE_ERROR_MESSAGE); return; } double amountForAdjustment = utilities.convertStringToDouble(amount.getValue().toString().trim()); String remarksForAdjustment = remarks.getValue().toString().trim().toLowerCase(); boolean result = payrollService.insertAdjustmentToPayroll(getPayrollId(), getAmountToBeReceive(), getAmountReceived(), amountForAdjustment, remarksForAdjustment); if (result) { adjustmentTable(); close(); getWindow().showNotification("Successfully added adjustment.", Window.Notification.TYPE_HUMANIZED_MESSAGE); } } }); vlayout.addComponent(saveAdjustments); ts.addComponent(vlayout); vlayout = new VerticalLayout(); vlayout.setMargin(true); vlayout.setSpacing(true); vlayout.setCaption("Adjustments Table"); Label label = new Label("Remarks: Click ID Column to delete Adjustment"); vlayout.addComponent(label); vlayout.addComponent(adjustmentTable()); Button closeBtn = new Button("CLOSE"); closeBtn.setWidth("100%"); closeBtn.addListener(closeBtnListener); vlayout.addComponent(closeBtn); ts.addComponent(vlayout); addComponent(ts); }