void confirmButton_actionPerformed(ActionEvent e) { // view close dialog... if (JOptionPane.showConfirmDialog( ClientUtils.getParentFrame(this), ClientSettings.getInstance().getResources().getResource("close credit note?"), ClientSettings.getInstance().getResources().getResource("credit note closing"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { Response res = ClientUtils.getData("closeSaleDoc", controller.getPk()); if (!res.isError()) { confirmButton.setEnabled(false); headerFormPanel.setMode(Consts.READONLY); headerFormPanel.executeReload(); if (getInvoices() != null) getInvoices().reloadCurrentBlockOfData(); } else JOptionPane.showMessageDialog( ClientUtils.getParentFrame(this), res.getErrorMessage(), ClientSettings.getInstance().getResources().getResource("credit note closing"), JOptionPane.ERROR_MESSAGE); } }
public GridControl getInvoices() { if (controller.getParentFrame() != null) return controller.getParentFrame().getGrid(); else return null; }