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,
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:
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
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
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
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
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
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
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