1

I would like to know the result of a query performed in a popup that extend to windowPane.

Here is my class that open the window:

private void processBtnChangeRateAction(ActionEvent e) {
        AccountChangeRate win = new AccountChangeRate(clientRef, lblClientRate.getText(),a , app);
        win.setModal(true);
        win.setListener(new ActionListener() {
            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent e) {
                WindowMessage win = new WindowMessage("Saved");
                getApplication().addWindow(win);
            }
        });
        getApplication().addWindow(win);
}

here is the window Class:

public AccountChangeRate(String clientRef, String old_rate, Account a, Application app) {
    super();
    this.clientRef = clientRef;
    this.old_rate = old_rate;
    this.a = a;
    initComponents();

}

private void processBtnSaveAction(ActionEvent e) {

    String msg = "Saved";
    app = getApplication();
    List<Product> list = bc.getProducts(a, app);
    try{
        if(rate.getText() == "N/A" || rate.getText() == ""){
            msg = "Please enter a Rate before saving.";
        }else{
            bc.editProduct(a.getHandle().getAccountNumber(), list.get(0).getName(), rate.getText(), startDate.getText(), app);
        }
    } catch (RateNotFoundException_Exception e1) {
        // TODO Auto-generated catch block
        msg = "The Rate you entered does not exist in the database.";
        e1.printStackTrace();
    }
    if(!msg.equals("Saved")){
        // HERE I Would like to sent a event that says that there was an issue.
    }else{
        l.actionPerformed(e);
        getParent().remove(this);
    }
}

How can i handle this? any suggestion?

Marc El Bichon
  • 397
  • 1
  • 7
  • 24

0 Answers0