0

modal window during onDrop

asked 2014-04-25 18:49:07 +0800

robertkaren gravatar image robertkaren
77 7

updated 2014-04-27 18:36:25 +0800

I tried calling a modal window from a controller during an onDrop event. the modal window works (stops user events w/ rest of app) but it allows the drop event to complete before it appears. How can I write it in a way that it stops the onDrop itself (before calling dropClass.dropOnTextWin() below) until the user closes the window? or should I be designing it differently. Thanks for any help! I am calling it like this:

    @Listen("onDrop = #codeBoxWindow #codeBox")
public void onDropDoWrapperCode (DropEvent drpEvt) {
    handleDrop(drpEvt);
}

    private void handleDrop (DropEvent evt) {
    if (selectedMultipleItems(evt)) {
            AndOrPlusModal andOrPlusModal = new AndOrPlusModal();
    }
    dropClass.dropOnTextWin(evt, codeBox, titleBox);
}

and AndOrPlusModal looks like this:

public class AndOrPlusModal {
AndOrPlusModal() {
    createWindow();
}
private void createWindow() {
    try {
        Window win = (Window)Executions.createComponents("/modalOpAfterDrop.zul",null, null);
        win.doModal();
    } catch (Exception exe) {
        ErrorMessage.showErrorMsg("Failed to open window with operators (and/or/plus...). The error message was: " + exe.getMessage(), 
                "Error", Messagebox.OK, Messagebox.ERROR);
    }
}

}

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-05-01 02:04:35 +0800

robertkaren gravatar image robertkaren
77 7

updated 2014-05-01 02:05:12 +0800

I accomplished this w/ an event. I publish it from the button click in the window made w/ createComponents() and listen for it in the other controller. the listen event finishes the drop. look up eventqueues in the documentation for an example.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-04-25 18:49:07 +0800

Seen: 13 times

Last updated: May 01 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More