You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Brown, Berlin [GCG-PFS]" <Be...@Primerica.com> on 2011/03/19 23:45:12 UTC

Ajax modal window does not allow submit form under open browsers

When I use the ajax modal window and under Firefox/Chrome/Safari, the
ajax form submit does not happen.  When I open the ajax debug window, it
looks like a request is made.
 
Has anyone had issues with modal windows, form submission and firefox?
 
Internet Explorer 7 works fine.
 
Version of Wicket: 1.4.13
 
Here is the error in the debug window:
 
RROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
'calloutForm449' that is not in document.
ERROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
'calloutForm449' that is not in 
 
Pseduo Code:
 
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
...
 

final ModalWindow modalWindow = new ModalWindow( "modalWindow");
final Panel basicPanel = new BasicPanel( modalWindow.getContentId());
 
modalWindow.setInitialWidth( 600 );
mainPanel.add(modalWindow);
modalWindow.setContent(basicPanel);
 

...
 
public class BasicPanel extends Panel {
 
  public BasicPanel(final String id) {
    ...
    final Form form = new Form("calloutForm");        
    add(form);
  }
}

** Panel for Modal Window Markup:
 
<form wicket:id="calloutForm"> 
  ...
</form>
 
 
** Output from ajax debug window.
 
The form looks like it is available.
 
<div id="feedback4d7" style="display:none"></div>
<form id="calloutForm4d8" method="post"
action="?wicket:interface=:10:contentPanelContainer:contentPanel:panel:m
odalWindow:content:calloutForm::IFormSubmitListener::" ><div
style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;ove
rflow:hidden"><input type="hidden" name="calloutForm4d8_hf_0"
id="calloutForm4d8_hf_0" /></div>   
 <fieldset>
    <table cellspacing="0" cellpadding="0" style="width: auto;"
class="content_panel_table">
     <tbody>
 ...
 ....
</form>
</div>
 
 
 

Re: Ajax modal window does not allow submit form under open browsers

Posted by Pedro Santos <pe...@gmail.com>.
Forget my last comment, your patch maintains the hierarchy, just need to see
if it do not implies into style problems. JQuery also move the dialog
element to the top. Probably because an element with the css property
position=relative in the middle of hierarchy can cause presentation
problems.

On Mon, Mar 21, 2011 at 10:17 AM, Pedro Santos <pe...@gmail.com> wrote:

> The patch look good, but will force all current nested forms inside some
> modal window to override the Form#isRootForm to return true
> A possible way of avoid is to flag the mismatch in hierarchy. Join us in
> the dev mail list to discuss, there is even a thread already:
>
>
> http://markmail.org/search/?q=wicket#query:wicket%20list%3Aorg.apache.wicket.dev%20date%3A201102%20from%3A%22Pedro%20Santos%22+page:1+mid:lrhm4gcg7cxoskgm+state:results
>
>
>
> On Mon, Mar 21, 2011 at 10:01 AM, Sven Meier <sv...@meiers.net> wrote:
>
>> Hi Pedro,
>>
>> modal window renders its content into its own tag's body before moving it
>> into new tags on the top level.
>> In the proposed patch this intermediate step is skipped, thus keeping the
>> markup valid even in case of a form in the dialog's content.
>>
>>
>> Pedro Santos wrote:
>> >
>> > I don't remember of any change in this.
>> >
>>
>> The patch was not accepted for 1.5.
>>
>> Best regards
>>
>> Sven
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Ajax-modal-window-does-not-allow-submit-form-under-open-browsers-tp3390374p3393492.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>



-- 
Pedro Henrique Oliveira dos Santos

Re: Ajax modal window does not allow submit form under open browsers

Posted by Pedro Santos <pe...@gmail.com>.
The patch look good, but will force all current nested forms inside some
modal window to override the Form#isRootForm to return true
A possible way of avoid is to flag the mismatch in hierarchy. Join us in the
dev mail list to discuss, there is even a thread already:

http://markmail.org/search/?q=wicket#query:wicket%20list%3Aorg.apache.wicket.dev%20date%3A201102%20from%3A%22Pedro%20Santos%22+page:1+mid:lrhm4gcg7cxoskgm+state:results



On Mon, Mar 21, 2011 at 10:01 AM, Sven Meier <sv...@meiers.net> wrote:

> Hi Pedro,
>
> modal window renders its content into its own tag's body before moving it
> into new tags on the top level.
> In the proposed patch this intermediate step is skipped, thus keeping the
> markup valid even in case of a form in the dialog's content.
>
>
> Pedro Santos wrote:
> >
> > I don't remember of any change in this.
> >
>
> The patch was not accepted for 1.5.
>
> Best regards
>
> Sven
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Ajax-modal-window-does-not-allow-submit-form-under-open-browsers-tp3390374p3393492.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

Re: Ajax modal window does not allow submit form under open browsers

Posted by Sven Meier <sv...@meiers.net>.
Hi Pedro,

modal window renders its content into its own tag's body before moving it
into new tags on the top level.
In the proposed patch this intermediate step is skipped, thus keeping the
markup valid even in case of a form in the dialog's content.


Pedro Santos wrote:
> 
> I don't remember of any change in this.
> 

The patch was not accepted for 1.5.

Best regards

Sven

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajax-modal-window-does-not-allow-submit-form-under-open-browsers-tp3390374p3393492.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Ajax modal window does not allow submit form under open browsers

Posted by Pedro Santos <pe...@gmail.com>.
The modal window's content is rendered into a set of new elements into the
page body directly, this set include a form tag. If you add a root form
inside the modal window content, the HTML for the opened window will be
invalid because of nested form tags. I don't remember of any change in this.

On Mon, Mar 21, 2011 at 8:15 AM, Sven Meier <sv...@meiers.net> wrote:

> Yes, the extra form in modal window is no longer needed.
>
> This works because a modal window's content is 'just' rendered into a new
> element in the page body directly.
>
> Sven
>
>
> Brown, Berlin [GCG-PFS] wrote:
> >
> > OK, so the patch just scraps the form in the modal window.
> >
> > -----Original Message-----
> > From: Chris Colman [mailto:chrisc@stepaheadsoftware.com]
> > Sent: Sunday, March 20, 2011 8:36 AM
> > To: users@wicket.apache.org
> > Subject: RE: Ajax modal window does not allow submit form under open
> > browsers
> >
> > &gt;.. and please vote for WICKET-3404 if you think the need for this
> > &gt;additional form is just annoying.
> >
> > +1 from me!
> >
> > I find having to wrap a modal in a form quite annoying.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Ajax-modal-window-does-not-allow-submit-form-under-open-browsers-tp3390374p3393166.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

RE: Ajax modal window does not allow submit form under open browsers

Posted by Sven Meier <sv...@meiers.net>.
Yes, the extra form in modal window is no longer needed. 

This works because a modal window's content is 'just' rendered into a new
element in the page body directly.

Sven


Brown, Berlin [GCG-PFS] wrote:
> 
> OK, so the patch just scraps the form in the modal window. 
> 
> -----Original Message-----
> From: Chris Colman [mailto:chrisc@stepaheadsoftware.com] 
> Sent: Sunday, March 20, 2011 8:36 AM
> To: users@wicket.apache.org
> Subject: RE: Ajax modal window does not allow submit form under open
> browsers
> 
> &gt;.. and please vote for WICKET-3404 if you think the need for this 
> &gt;additional form is just annoying.
> 
> +1 from me!
> 
> I find having to wrap a modal in a form quite annoying.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajax-modal-window-does-not-allow-submit-form-under-open-browsers-tp3390374p3393166.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Ajax modal window does not allow submit form under open browsers

Posted by "Brown, Berlin [GCG-PFS]" <Be...@Primerica.com>.
OK, so the patch just scraps the form in the modal window. 

-----Original Message-----
From: Chris Colman [mailto:chrisc@stepaheadsoftware.com] 
Sent: Sunday, March 20, 2011 8:36 AM
To: users@wicket.apache.org
Subject: RE: Ajax modal window does not allow submit form under open
browsers

>.. and please vote for WICKET-3404 if you think the need for this 
>additional form is just annoying.

+1 from me!

I find having to wrap a modal in a form quite annoying.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Ajax modal window does not allow submit form under open browsers

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
>.. and please vote for WICKET-3404 if you think the need for this
>additional form is just annoying.

+1 from me!

I find having to wrap a modal in a form quite annoying.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Ajax modal window does not allow submit form under open browsers

Posted by Sven Meier <sv...@meiers.net>.
.. and please vote for WICKET-3404 if you think the need for this 
additional form is just annoying.

Sven

On 03/20/2011 01:01 AM, Pedro Santos wrote:
> To submit a form inside a modal window you must enclose it by a form in the
> main panel and use an AJAX submit component. Please open a ticket +
> quickstart if the issue remains.
>
> On Sat, Mar 19, 2011 at 7:45 PM, Brown, Berlin [GCG-PFS]<
> Berlin.Brown@primerica.com>  wrote:
>
>> When I use the ajax modal window and under Firefox/Chrome/Safari, the
>> ajax form submit does not happen.  When I open the ajax debug window, it
>> looks like a request is made.
>>
>> Has anyone had issues with modal windows, form submission and firefox?
>>
>> Internet Explorer 7 works fine.
>>
>> Version of Wicket: 1.4.13
>>
>> Here is the error in the debug window:
>>
>> RROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
>> 'calloutForm449' that is not in document.
>> ERROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
>> 'calloutForm449' that is not in
>>
>> Pseduo Code:
>>
>> import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
>> ...
>>
>>
>> final ModalWindow modalWindow = new ModalWindow( "modalWindow");
>> final Panel basicPanel = new BasicPanel( modalWindow.getContentId());
>>
>> modalWindow.setInitialWidth( 600 );
>> mainPanel.add(modalWindow);
>> modalWindow.setContent(basicPanel);
>>
>>
>> ...
>>
>> public class BasicPanel extends Panel {
>>
>>   public BasicPanel(final String id) {
>>     ...
>>     final Form form = new Form("calloutForm");
>>     add(form);
>>   }
>> }
>>
>> ** Panel for Modal Window Markup:
>>
>> <form wicket:id="calloutForm">
>>   ...
>> </form>
>>
>>
>> ** Output from ajax debug window.
>>
>> The form looks like it is available.
>>
>> <div id="feedback4d7" style="display:none"></div>
>> <form id="calloutForm4d8" method="post"
>> action="?wicket:interface=:10:contentPanelContainer:contentPanel:panel:m
>> odalWindow:content:calloutForm::IFormSubmitListener::"><div
>> style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;ove
>> rflow:hidden"><input type="hidden" name="calloutForm4d8_hf_0"
>> id="calloutForm4d8_hf_0" /></div>
>>   <fieldset>
>>     <table cellspacing="0" cellpadding="0" style="width: auto;"
>> class="content_panel_table">
>>      <tbody>
>>   ...
>>   ....
>> </form>
>> </div>
>>
>>
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Ajax modal window does not allow submit form under open browsers

Posted by Pedro Santos <pe...@gmail.com>.
On Sat, Mar 19, 2011 at 10:00 PM, Brown, Berlin [GCG-PFS] <
Berlin.Brown@primerica.com> wrote:

> You mean?
>
> Markup, main panel:
>
> <form>
>  <div wicket:id="thePanelForModalWindow"></div>
> </form>
>
>
the markup will look like:

<form wicket:id="formComponentId">
 <div wicket:id="modalWindow"></div>
</form>

<wicket:panel>
  <form wicket:id="formInsideThePanelForModalWindow"></form>
</wicket:panel>

OK, but why does it work with Internet Explorer 7.  Strange.
>

If you add a root form component inside the modal window the generated
markup will have 2 nested form tags which is illegal. Each browser have its
own tolerance for illegal HTML


>
> -----Original Message-----
> From: Pedro Santos [mailto:pedrosans@gmail.com]
> Sent: Saturday, March 19, 2011 8:02 PM
> To: users@wicket.apache.org
> Subject: Re: Ajax modal window does not allow submit form under open
> browsers
>
> To submit a form inside a modal window you must enclose it by a form in
> the main panel and use an AJAX submit component. Please open a ticket +
> quickstart if the issue remains.
>
> On Sat, Mar 19, 2011 at 7:45 PM, Brown, Berlin [GCG-PFS] <
> Berlin.Brown@primerica.com> wrote:
>
> > When I use the ajax modal window and under Firefox/Chrome/Safari, the
> > ajax form submit does not happen.  When I open the ajax debug window,
> > it looks like a request is made.
> >
> > Has anyone had issues with modal windows, form submission and firefox?
> >
> > Internet Explorer 7 works fine.
> >
> > Version of Wicket: 1.4.13
> >
> > Here is the error in the debug window:
> >
> > RROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
> > 'calloutForm449' that is not in document.
> > ERROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
> > 'calloutForm449' that is not in
> >
> > Pseduo Code:
> >
> > import
> > org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
> > ...
> >
> >
> > final ModalWindow modalWindow = new ModalWindow( "modalWindow"); final
>
> > Panel basicPanel = new BasicPanel( modalWindow.getContentId());
> >
> > modalWindow.setInitialWidth( 600 );
> > mainPanel.add(modalWindow);
> > modalWindow.setContent(basicPanel);
> >
> >
> > ...
> >
> > public class BasicPanel extends Panel {
> >
> >  public BasicPanel(final String id) {
> >    ...
> >    final Form form = new Form("calloutForm");
> >    add(form);
> >  }
> > }
> >
> > ** Panel for Modal Window Markup:
> >
> > <form wicket:id="calloutForm">
> >  ...
> > </form>
> >
> >
> > ** Output from ajax debug window.
> >
> > The form looks like it is available.
> >
> > <div id="feedback4d7" style="display:none"></div> <form
> > id="calloutForm4d8" method="post"
> > action="?wicket:interface=:10:contentPanelContainer:contentPanel:panel
> > :m odalWindow:content:calloutForm::IFormSubmitListener::" ><div
> > style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;o
> > ve rflow:hidden"><input type="hidden" name="calloutForm4d8_hf_0"
> > id="calloutForm4d8_hf_0" /></div>
> >  <fieldset>
> >    <table cellspacing="0" cellpadding="0" style="width: auto;"
> > class="content_panel_table">
> >     <tbody>
> >  ...
> >  ....
> > </form>
> > </div>
> >
> >
> >
> >
>
>
> --
> Pedro Henrique Oliveira dos Santos
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

RE: Ajax modal window does not allow submit form under open browsers

Posted by "Brown, Berlin [GCG-PFS]" <Be...@Primerica.com>.
You mean?

Markup, main panel:

<form>
  <div wicket:id="thePanelForModalWindow"></div>
</form> 

OK, but why does it work with Internet Explorer 7.  Strange.

-----Original Message-----
From: Pedro Santos [mailto:pedrosans@gmail.com] 
Sent: Saturday, March 19, 2011 8:02 PM
To: users@wicket.apache.org
Subject: Re: Ajax modal window does not allow submit form under open
browsers

To submit a form inside a modal window you must enclose it by a form in
the main panel and use an AJAX submit component. Please open a ticket +
quickstart if the issue remains.

On Sat, Mar 19, 2011 at 7:45 PM, Brown, Berlin [GCG-PFS] <
Berlin.Brown@primerica.com> wrote:

> When I use the ajax modal window and under Firefox/Chrome/Safari, the 
> ajax form submit does not happen.  When I open the ajax debug window, 
> it looks like a request is made.
>
> Has anyone had issues with modal windows, form submission and firefox?
>
> Internet Explorer 7 works fine.
>
> Version of Wicket: 1.4.13
>
> Here is the error in the debug window:
>
> RROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id 
> 'calloutForm449' that is not in document.
> ERROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id 
> 'calloutForm449' that is not in
>
> Pseduo Code:
>
> import 
> org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
> ...
>
>
> final ModalWindow modalWindow = new ModalWindow( "modalWindow"); final

> Panel basicPanel = new BasicPanel( modalWindow.getContentId());
>
> modalWindow.setInitialWidth( 600 );
> mainPanel.add(modalWindow);
> modalWindow.setContent(basicPanel);
>
>
> ...
>
> public class BasicPanel extends Panel {
>
>  public BasicPanel(final String id) {
>    ...
>    final Form form = new Form("calloutForm");
>    add(form);
>  }
> }
>
> ** Panel for Modal Window Markup:
>
> <form wicket:id="calloutForm">
>  ...
> </form>
>
>
> ** Output from ajax debug window.
>
> The form looks like it is available.
>
> <div id="feedback4d7" style="display:none"></div> <form 
> id="calloutForm4d8" method="post"
> action="?wicket:interface=:10:contentPanelContainer:contentPanel:panel
> :m odalWindow:content:calloutForm::IFormSubmitListener::" ><div 
> style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;o
> ve rflow:hidden"><input type="hidden" name="calloutForm4d8_hf_0"
> id="calloutForm4d8_hf_0" /></div>
>  <fieldset>
>    <table cellspacing="0" cellpadding="0" style="width: auto;"
> class="content_panel_table">
>     <tbody>
>  ...
>  ....
> </form>
> </div>
>
>
>
>


--
Pedro Henrique Oliveira dos Santos


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Ajax modal window does not allow submit form under open browsers

Posted by Pedro Santos <pe...@gmail.com>.
To submit a form inside a modal window you must enclose it by a form in the
main panel and use an AJAX submit component. Please open a ticket +
quickstart if the issue remains.

On Sat, Mar 19, 2011 at 7:45 PM, Brown, Berlin [GCG-PFS] <
Berlin.Brown@primerica.com> wrote:

> When I use the ajax modal window and under Firefox/Chrome/Safari, the
> ajax form submit does not happen.  When I open the ajax debug window, it
> looks like a request is made.
>
> Has anyone had issues with modal windows, form submission and firefox?
>
> Internet Explorer 7 works fine.
>
> Version of Wicket: 1.4.13
>
> Here is the error in the debug window:
>
> RROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
> 'calloutForm449' that is not in document.
> ERROR: Wicket.Ajax.Call.submitFormById: Trying to submit form with id
> 'calloutForm449' that is not in
>
> Pseduo Code:
>
> import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
> ...
>
>
> final ModalWindow modalWindow = new ModalWindow( "modalWindow");
> final Panel basicPanel = new BasicPanel( modalWindow.getContentId());
>
> modalWindow.setInitialWidth( 600 );
> mainPanel.add(modalWindow);
> modalWindow.setContent(basicPanel);
>
>
> ...
>
> public class BasicPanel extends Panel {
>
>  public BasicPanel(final String id) {
>    ...
>    final Form form = new Form("calloutForm");
>    add(form);
>  }
> }
>
> ** Panel for Modal Window Markup:
>
> <form wicket:id="calloutForm">
>  ...
> </form>
>
>
> ** Output from ajax debug window.
>
> The form looks like it is available.
>
> <div id="feedback4d7" style="display:none"></div>
> <form id="calloutForm4d8" method="post"
> action="?wicket:interface=:10:contentPanelContainer:contentPanel:panel:m
> odalWindow:content:calloutForm::IFormSubmitListener::" ><div
> style="width:0px;height:0px;position:absolute;left:-100px;top:-100px;ove
> rflow:hidden"><input type="hidden" name="calloutForm4d8_hf_0"
> id="calloutForm4d8_hf_0" /></div>
>  <fieldset>
>    <table cellspacing="0" cellpadding="0" style="width: auto;"
> class="content_panel_table">
>     <tbody>
>  ...
>  ....
> </form>
> </div>
>
>
>
>


-- 
Pedro Henrique Oliveira dos Santos