Re: modal dialog and nesting of forms.

2012-02-17 Thread Sven Meier
imho simpler to put a form inside modal's panel and call it a day IMHO the modalwindow-form requirement is weird. It's counter-intuitive and inelegant - just look at all the html elements created in modal window's js. It breaks encapsulation: Why should I put the modal window into a form,

Re: modal dialog and nesting of forms.

2012-02-16 Thread Igor Vaynberg
the whole idea of putting the modal into a wicket form is that forms inside the modal should change their form tags to divs because they see they are inside another form... -igor On Thu, Feb 16, 2012 at 11:16 AM, Johan Compagner jcompag...@gmail.com wrote: here:

Re: modal dialog and nesting of forms.

2012-02-16 Thread Johan Compagner
yes i just read that in a jira issue :) but in my example it doesn't ... will check it On Thu, Feb 16, 2012 at 20:20, Igor Vaynberg igor.vaynb...@gmail.comwrote: the whole idea of putting the modal into a wicket form is that forms inside the modal should change their form tags to divs because

Re: modal dialog and nesting of forms.

2012-02-16 Thread Johan Compagner
ok for a form inside a modal dialog you need to override: /** * @see org.apache.wicket.markup.html.form.Form#isRootForm() */ @Override public boolean isRootForm() { return false; } because the default behavior will ofcourse

Re: modal dialog and nesting of forms.

2012-02-16 Thread Igor Vaynberg
the modal dialog form is, but since the panel is rendered inside modal's parent initially the wicket form inside the modal should see the wicket form that the modal itself is in... the rendered hierarchy should be like this form - wicket form modal window content panel div - wicket

Re: modal dialog and nesting of forms.

2012-02-16 Thread Johan Compagner
but the modal dialog iself is not in a form.. there are only 2 forms in my example the one that the modal dialog generates in js code and the one inside the panel that i show in the modal dialog But it is fixed by overriding that isRootForm() and returning false myself then it works just fine

Re: modal dialog and nesting of forms.

2012-02-16 Thread Igor Vaynberg
thats why the javadoc says to put the modal window component inside a wicket form... -igor On Thu, Feb 16, 2012 at 11:55 AM, Johan Compagner jcompag...@gmail.com wrote: but the modal dialog iself is not in a form.. there are only 2 forms in my example the one that the modal dialog generates

Re: modal dialog and nesting of forms.

2012-02-16 Thread Johan Compagner
its way better to say that you should override that method and return false.. because now you have to already know that you will show forms in a dialog and place a form on some page.. What if you just have a modal window that you reuse all over the place in many pages then you have to add a

Re: modal dialog and nesting of forms.

2012-02-16 Thread Igor Vaynberg
On Thu, Feb 16, 2012 at 12:03 PM, Johan Compagner jcompag...@gmail.com wrote: its way better to say that you should override that method and return false.. that would require every panel that has a form to be built with this in mind. imho much simpler to always put the modal inside a form