-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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);
}
}
}
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.
Asked: 2014-04-25 18:49:07 +0800
Seen: 14 times
Last updated: May 01 '14