Hello All,
I am unable to close modalwindow which contains a panel with the form.My
code snippet in page is as 

follows:
.........

  final DataView dataView = new DataView("rows", new
ListDataProvider(folderList)) {

                public void populateItem(final Item item) {
                    FolderWrapper fw = (FolderWrapper)
item.getModelObject();
                    item.add(new CheckBox("checkbox", new PropertyModel(fw,
"selected")));
                    item.add(new Label("subKeyword",
fw.getKeyword().getSubKeyword()));
                    item.add(new Label("description",
fw.getKeyword().getDescription()));
                    item.add(new Label("email",
fw.getKeyword().getEmail()));

                    AjaxLink editLink = new AjaxLink("edit") {

                        public void onClick(AjaxRequestTarget target) {
                            FolderWrapper selectedKeyword =
(FolderWrapper)getParent().getModelObject();
                            modalS.setContent(new
FolderEditPanel(modalS.getContentId(),          
                                      selectedKeyword.getKeyword(), modalS));
                            modalS.setTitle("Details:");
                            modalS.show(target);
                        }
                    };

                    modalS = new ModalWindow("modalS");
                    modalS.setInitialWidth(450);
                    modalS.setInitialHeight(200);
                    modalS.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback() {

                        public void onClose(AjaxRequestTarget target) {
                            modalS.close(target);
                        }
                    });
                    editLink.add(modalS);
                    item.add(editLink);

.............


And the Panel which contains edit form :

  public FolderEditPanel(String id, Keyword keyword, final ModalWindow
window) {
        super(id);
        selectedKeyword = keyword;
        Form folderEditForm = new FolderEditForm("form");
        folderEditForm.setOutputMarkupId(true);
        add(folderEditForm);
        folderEditForm.add(new AjaxButton("ok") {

            @Override
            protected void onSubmit(AjaxRequestTarget target, Form form) {
                try {
                    selectedKeyword.edit();
                } catch (SQLException e) {
                    String err = e.getMessage();
                }
                window.close(target);
            }
        });
    }

But similar codes works fine when I don't use wrapper(i.e FolderWrapper to
add checkbox to select 

items). 

Thanks,
tsuresh

-- 
View this message in context: 
http://www.nabble.com/Unable-to-close-modalwindow-tp16981993p16981993.html
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