Why not use the panel directly?
I use panels for my modal window and it works fine:)
I meant this:
|myformPanel
|
|-myformPanelWithAjaxSubmitANDModalAware
|-myformPanelWithNormalButton
And this for displaying:
AjaxLink popupLink = new AjaxLink("manageWeightPop") {
@Override
public void onClick(AjaxRequestTarget target) {
target
.appendJavascript("Wicket.Window.unloadConfirmation = false;");
modalWindow.setTitle("Weight Log.");
modalWindow.setMinimalHeight(700);
modalWindow.setContent(new ManageWeightPanel(modalWindow
.getContentId(), modalWindow,
new BaseEntityDetachableModel(getPerson())));
modalWindow.show(target);
}
};
regards Nino
Maurice Marrink wrote:
I think it would be even better to wrap the panel nino is talking
about in a new page for your modal window.
Maurice
On Tue, Apr 8, 2008 at 2:59 PM, Nino Saturnino Martinez Vazquez Wael
<[EMAIL PROTECTED]> wrote:
Korbinian Bachl - privat wrote:
Hello,
I've noticed that a Form inside a ModalWindow can't be submitted using the
onSubmit function (and dislikes a standard submit button) but instead
requires an AjaxButton to call the action - why is this so? It makes my life
currently somehow hard as I need 2 nearly identical forms - one with
AjaxButton (in case I want to use it in ModalWindow), one without
AjaxButton for non JS pages.
Because of the server round trip I think.. Why not have one panel, which
contains your form and then two childs, which adds the submit part eg a
submit link etc...
Also I noticed a strage behaviour:
when using ModalWindow with a Page we have the pageConstructor() that
creates a whole new page (all models are fresh) when opening it, while in
case you use it with a Panel/ Component the component is created just once
and Models arent cleaned up in case you close the window and reopen it
(e.g.: a form you put in and submit and close window and reopen it using
initial link displays the submited values) - opposite behaviour compared to
ModalWindow with Page where on each creation all is cleaned.
Best,
Korbinian
--
-Wicket for love
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
--
-Wicket for love
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684