in your panel:
final ModalWindow modal;
add(modal = new ModalWindow("modalAdvancedSearch"));
add(new AjaxLink("openModal") {
@Override
public void onClick(AjaxRequestTarget target) {
modal.show(target);
}
});
modal.setCloseButtonCallback(new ModalWindow.CloseButtonCallback() {
public boolean onCloseButtonClicked(AjaxRequestTarget target) {
return true;
}
});
modal.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback() {
public void onClose(AjaxRequestTarget target) {
setResponsePage();
}
});
Crag wrote:
> An open modalwindow, when the form had been submmitted, I want to refresh
> parent window , and close current window, how to do ?
>
> the simple code:
>
> <html>
> <head></head>
> <body>
> <form wicket:id="nodeForm">
> <table>
> <tr>
> <td>
> <input wicket:id="name" type="text" />
> </td>
> </tr>
> <tr>
> <td >
> <input wicket:id="edit" type="submit" value="Add/Update"
> onclick="return confirm('Are you sure you want to edit?')" />
> </td>
> </tr>
> </table>
> </form>
> </body>
> </html>
>
>
> public class EditModal extends WebPage {
> private static final long serialVersionUID = 1L;
>
> public Tree0EditModal(final ModalWindowPage modalWindowPage, IModel model)
> {
>
> final NodeForm form = new NodeForm("nodeForm", model);
>
> Button btnEdit = new Button("edit") {
> protected void onSubmit( ) {
> System.out.println("submit...........");
> // now I want to refresh parent window(modalWindowPage), and close
> current window(EditModal), how to do ?
> //ModalWindow.close(target);
> }
> };
>
> form.add(btnEdit);
> TextField name = new TextField("name");
>
> form.add(name);
>
> add(form);
> }
>
> class NodeForm extends Form {
> private static final long serialVersionUID = 1L;
>
> public NodeForm(String id, IModel model) {
> super(id, model);
> }
> }
> }
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user