0

I'm new to wicket, and i have problem with modal window. What im trying to do is, when i click a button on page to remove user from list, modal window show's asking if I am sure to delete user, after click on Confirm button user is removed from the list and window is closed, but if remove operation fail's (some exception), second modal window should appear informing me about what exception was thrown, and the first window should be automatically closed (or after click on Continue button on second both of them should be closed). My problem is that first window is closed only after click on cancel button and i don't know how to resolve it. My code look's like:

    doRemoveAction(account, target){
selectModalWindow.show(target)
}
    SelectModalWindow deleteConfirmWindow = new SelectModalWindow("modal", title, message){

    void onConfirm(AjaxRequestTarget target){ 
    try{
       remove(account);close(target);
    }catch(Exception e){
         infoModalWarning.show(target);
     }

     void onCancle(AjaxRequestTarget target){
        close(target);
    }
     private InfoModalWindow infoModalWindow = new InfoModalWindow(
                "infomodalwindow", title) {

          public void submit(AjaxRequestTarget target) {
              close(target);
            }
        };

I hope I made myself clear, thanks for helping.

  • Why not close the modal first and then remove the account? In your try: close(target);remove(account); – papkass Oct 11 '13 at 12:10

1 Answers1

0

There has been a bug with Wicket (WICKET-5101) that prevented opening a second Modal window from within the first one. With Wicket 6.12 this has been fixed.

black666
  • 2,997
  • 7
  • 25
  • 40