Hi Nino,

Why not use the panel directly?

I use panels for my modal window and it works fine:)

I meant this:
|myformPanel
|
|-myformPanelWithAjaxSubmitANDModalAware
|-myformPanelWithNormalButton

so you have a Panel holding the Form and extend this then to hold the right submitter then? I mean this would go to 3 Java + 3 HTML files for 1 form, seems a bit much on the long run for me.


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);
           }
       };

youre creating a modalWindow here directly using JS? Or where do you create it?

Im currently creating a final ModalWindow and attaching it to a fixed div while calling it:
 final ModalWindow mw = new ModalWindow("mw");
EigenschaftenFormPanel ep = new EigenschaftenFormPanel(mw.getContentId(), new Eigenschaften());
        ep.setWindow(mw);
        mw.setContent(ep);
        mw.setInitialHeight(140);
        mw.setResizable(false);

add(new AjaxLink("showmw")
        {
            public void onClick(AjaxRequestTarget target)
            {
                mw.show(target);
            }
        });

Is this the right usage then?

Best,

Korbinian



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





Reply via email to