Thanks Stefan.

I figured that this is what I was left with...had to wait to the
onWindowCloseCallback to handle the user action properly.  

I was hoping for a more elegant (already built) means to be able to "pass
back" to the calling ModalWindow to identify what "action" was performed. 
But since I was not able to find anything, I did the following:

1) Created a ModalWindowCallbackState

public class ModalWindowCallbackState implements Serializable {
        public Object value;
}

2) Passed that into my displayed component in the ModalWindow

final ModalWindowCallbackState callbackState = new
ModalWindowCallbackState();

...

successWindow.setPageCreator(new ModalWindow.PageCreator() {
        public Page createPage() {
                return new SuccessConfirmation(successWindow, callbackState);
        }
});


3)  Check the callback state in the onWindowClosedCallback

successWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback()
{
        public void onClose(AjaxRequestTarget target) {
                if ( callbackState.value == null || callbackState.value.equals( 
/* Cancel
*/ ) {
                        setResponsePage( /* CancelPage */ );
                }
                else if ( callbackState.value.equals( /* ACTION FOO */)) {
                        setResponsePage(  /* FooPage */ );
                }
                ...
        } );
-- 
View this message in context: 
http://www.nabble.com/ModalWindow-question-tf4731828.html#a13532596
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to