[ 
https://issues.apache.org/jira/browse/WICKET-1003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530630
 ] 

Carlo M. Camerino commented on WICKET-1003:
-------------------------------------------

Still doesn't work with latest snapshot

If I change the IndicatingAjaxButton to an AjaxLink it closes properly.

public class ConfirmWindowPanel extends Panel {
        private ButtonCommand buttonCommand;
        
        
        public ButtonCommand getButtonCommand() {
                return buttonCommand;
        }

        public void setButtonCommand(ButtonCommand buttonCommand) {
                this.buttonCommand = buttonCommand;
        }

        public ConfirmWindowPanel(String id) {
                super(id);
                // TODO Auto-generated constructor stub
                add(new 
ConfirmWindowPanelForm(WicketConstants.WICKET_CONFIRM_FORM));
        }

        class ConfirmWindowPanelForm extends Form {

                public ConfirmWindowPanelForm(String id) {
                        super(id);
                        // TODO Auto-generated constructor stub
                        add(new IndicatingAjaxButton("back-button", this) {
                                @Override
                                public void onSubmit(AjaxRequestTarget target, 
Form form) {
                                        ModalWindow modalWindow = (ModalWindow) 
this.getParent().getParent().getParent();
                                        modalWindow.close(target);
                                }
                                
                        });
                        add(new IndicatingAjaxButton("confirm-button", this) {

                                @Override
                                public void onSubmit(AjaxRequestTarget target, 
Form form ) {
                                        ModalWindow modalWindow = (ModalWindow) 
this.getParent().getParent().getParent();
                                        CommonBasePage commonBasePage = 
(CommonBasePage) this.getPage();
                                        
target.addComponent(commonBasePage.getFeedback());
                                        try {
                                                buttonCommand.submit();
                                        } catch(DataIntegrityViolationException 
e) {
                                                error("Unique constraint 
violated.");
                                                modalWindow.close(target);
                                        } catch(StaleObjectStateException e) {
                                                error("Row(s) was updated or 
deleted by another transaction.");
                                                modalWindow.close(target);
                                        } catch(VersionMismatchException e) {
                                                error("Row(s) was updated or 
deleted by another transaction.");
                                                modalWindow.close(target);
                                        }   catch(CCTIException e) {
                                                error(e.getMessage());
                                                modalWindow.close(target);
                                        }catch(RuntimeException e) {
                                                error("Application Error 
Occurred");
                                                modalWindow.close(target);
                                                e.printStackTrace();
                                        }catch(Exception e) {
                                                error("Application Error 
Occurred");
                                                modalWindow.close(target);
                                                e.printStackTrace();
                                        }
                                }
                                
                        });
                }
                
        }
}


> Modal Window Does Not Close When Using IndicatingAjaxButton
> -----------------------------------------------------------
>
>                 Key: WICKET-1003
>                 URL: https://issues.apache.org/jira/browse/WICKET-1003
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.3.0-beta4
>         Environment: Ubuntu, Jetty, Eclipse
>            Reporter: Carlo M. Camerino
>         Attachments: Modal.png, quickstart-closeDoesntWork.zip
>
>
> I have  a panel in my modal window. I have a button in my panel that closes 
> the modalwindow.
> If I use an indicatingajaxbutton for that button, the modalwindow does not 
> close properly.
> However if i use an ajaxlink, things go smoothly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to