You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by tomask79 <to...@embedit.cz> on 2014/10/30 09:42:40 UTC

Multipart form doesn't work with AjaxSubmitLink (1.5.8 - 6.17 upgrade)

Hi guys,

we're migrating to wicket 6.17 and I'm stuck at problem that AjaxSubmitLinks
are not working inside form, which is marked as multipart form, yes we have
there some upload fields. Method onSubmit of AjaxSubmitLinks never gets
called...:-(...I see NO ERRORS in the javascript console...Anyway AjaxLinks
in the same place are working fine....Back to problem:

*HTML of AjaxSubmitLink*



*Java*



*Link inside DOM:*



*Registered event in the new Wicket 6.0 style:*

Wicket.Ajax.ajax({"f":"form10e","mp":true,"u":"./application-form?3-3.IBehaviorListener.0-content-form-panesContainer-2-paneContent-panesContainer-0-paneContent-personsContainer-relatedPersons-2-remove&id=_AxmgvNX1d4A3Jiqlimy25exWY9xmL1U&tabId=a4UHLIwD5zvFwqfJ5Pw4","e":"click","c":"remove11d","sc":"panesContainer:2:paneContent:panesContainer:0:paneContent:personsContainer:relatedPersons:2:remove","m":"POST","i":"veil"});;


I was debugging wicket-ajax-jquery.js and jquery's ajax never get's called
in this case, because of the line:



Repeated clicking at the mentioned AjaxSubmitLink ends then in message:
*"Channel '0' is busy - scheduling the callback to be executed when the
previous request finish."* in the AJAX DEBUG CONSOLE.


Guys, any help would be highly appreciated...Maybe I should refactor
mentioned form in some way, but migration guide doesn't provide info
concerning AjaxSubmitLink...

Thank you very much in advance for any help

regards

Tomas







--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Multipart-form-doesn-t-work-with-AjaxSubmitLink-1-5-8-6-17-upgrade-tp4668161.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: Multipart form doesn't work with AjaxSubmitLink (1.5.8 - 6.17 upgrade)

Posted by Martin Grigorov <mg...@apache.org>.
Hi,


On Thu, Oct 30, 2014 at 11:52 AM, tomask79 <to...@embedit.cz> wrote:

> Hi Martin again,
>
> false alarm, I apologize.
>

No worries!
The important thing is that it works !


>
> As you mentioned, I debugged the wicket-ajax-jquery.js's
> submitMultipartForm
> function and found out that wicket was ending at the bold line:
>
> *wicket-ajax-jquery.js:*
> .
> .
> if (form.onsubmit && !form.getAttribute(submittingAttribute)) {
>         form.setAttribute(submittingAttribute, submittingAttribute);
>         var retValue = true;
>         try {
>                 retValue = form.onsubmit();
>         } finally {
>                 form.removeAttribute(submittingAttribute);
>         }
>         if (!retValue) {
>                 *return; <= Here was wicket returning with form
> unsubmitted*
>

This particular piece of code is in use in 1.5.x as well.


>         }
> }
> .....
>
> All because my colleague* have rewritten the form's onsubmit attribute*
> with
> his code..:-)
>

I recommend you when you migrate to new version to not make improvements in
your code. Just mark them for later, when the upgrade is finished.
Otherwise it is hard to find whether the new version of the library is
broken or your changes broke it.


> Which disposed the code provided by wicket.
>
> Martin I apologize again, it's just that upgrade to 6.0 is a little
> exhausting, because you changed a lot of things..:)
>

Migrating to 7.x should be much easier! There are no big refactorings and
the migration guide
<https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+7.0> is
very detailed.


>
> regards
>
> Tomas.
>
>
>
>                         }
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Multipart-form-doesn-t-work-with-AjaxSubmitLink-1-5-8-6-17-upgrade-tp4668161p4668164.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: Multipart form doesn't work with AjaxSubmitLink (1.5.8 - 6.17 upgrade)

Posted by tomask79 <to...@embedit.cz>.
Hi Martin again,

false alarm, I apologize.

As you mentioned, I debugged the wicket-ajax-jquery.js's submitMultipartForm
function and found out that wicket was ending at the bold line:

*wicket-ajax-jquery.js:*
.
.
if (form.onsubmit && !form.getAttribute(submittingAttribute)) {
	form.setAttribute(submittingAttribute, submittingAttribute);
        var retValue = true;
	try {
		retValue = form.onsubmit();
	} finally {
		form.removeAttribute(submittingAttribute);
	}
	if (!retValue) {
		*return; <= Here was wicket returning with form unsubmitted*
	}
}
.....

All because my colleague* have rewritten the form's onsubmit attribute* with
his code..:-)
Which disposed the code provided by wicket.

Martin I apologize again, it's just that upgrade to 6.0 is a little
exhausting, because you changed a lot of things..:)

regards

Tomas.



			}

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Multipart-form-doesn-t-work-with-AjaxSubmitLink-1-5-8-6-17-upgrade-tp4668161p4668164.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: Multipart form doesn't work with AjaxSubmitLink (1.5.8 - 6.17 upgrade)

Posted by tomask79 <to...@embedit.cz>.
Okay Martin, thanks for quick reply.

I will try to simulate it as you said and let you know.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Multipart-form-doesn-t-work-with-AjaxSubmitLink-1-5-8-6-17-upgrade-tp4668161p4668163.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: Multipart form doesn't work with AjaxSubmitLink (1.5.8 - 6.17 upgrade)

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Can you reproduce the problem in a quckstart ?
If YES then please attach it to JIRA and we will take a look.
You should go inside submitMultipartForm() with the debugger. When the form
is multipart Wicket needs to use an iframe to make the submit.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Oct 30, 2014 at 10:42 AM, tomask79 <to...@embedit.cz> wrote:

> Hi guys,
>
> we're migrating to wicket 6.17 and I'm stuck at problem that
> AjaxSubmitLinks
> are not working inside form, which is marked as multipart form, yes we have
> there some upload fields. Method onSubmit of AjaxSubmitLinks never gets
> called...:-(...I see NO ERRORS in the javascript console...Anyway AjaxLinks
> in the same place are working fine....Back to problem:
>
> *HTML of AjaxSubmitLink*
>
>
>
> *Java*
>
>
>
> *Link inside DOM:*
>
>
>
> *Registered event in the new Wicket 6.0 style:*
>
>
> Wicket.Ajax.ajax({"f":"form10e","mp":true,"u":"./application-form?3-3.IBehaviorListener.0-content-form-panesContainer-2-paneContent-panesContainer-0-paneContent-personsContainer-relatedPersons-2-remove&id=_AxmgvNX1d4A3Jiqlimy25exWY9xmL1U&tabId=a4UHLIwD5zvFwqfJ5Pw4","e":"click","c":"remove11d","sc":"panesContainer:2:paneContent:panesContainer:0:paneContent:personsContainer:relatedPersons:2:remove","m":"POST","i":"veil"});;
>
>
> I was debugging wicket-ajax-jquery.js and jquery's ajax never get's called
> in this case, because of the line:
>
>
>
> Repeated clicking at the mentioned AjaxSubmitLink ends then in message:
> *"Channel '0' is busy - scheduling the callback to be executed when the
> previous request finish."* in the AJAX DEBUG CONSOLE.
>
>
> Guys, any help would be highly appreciated...Maybe I should refactor
> mentioned form in some way, but migration guide doesn't provide info
> concerning AjaxSubmitLink...
>
> Thank you very much in advance for any help
>
> regards
>
> Tomas
>
>
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Multipart-form-doesn-t-work-with-AjaxSubmitLink-1-5-8-6-17-upgrade-tp4668161.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
>
>