You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Paul Stanton <pa...@mapshed.com.au> on 2010/06/08 05:42:18 UTC
LinkSubmit doesn't work
Hi,
I'm guessing I'm doing something wrong but it's hardly obvious. I have a
Form, with a LinkSubmit and a Submit:
<t:form t:id="myForm">
<t:linksubmit t:id="myLink">link</t:linksubmit>
<t:submit t:id="mySubmit" />
</t:form>
public void onSuccessFromMyForm()
{
LOG.debug("onSuccessFromMyForm");
}
public void onSelectedFromMyLink()
{
LOG.debug("onSelectedFromMyLink");
}
public void onSelectedFromMySubmit()
{
LOG.debug("onSelectedFromMySubmit");
}
The form is submitted and the listener(s) are called when I click the
submit, however nothing all all happens when I click the link.
p.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: LinkSubmit doesn't work
Posted by Paul Stanton <pa...@mapshed.com.au>.
i think you mixed up the email subjects ^ ??
Radek Terber wrote:
> I'm sorry, I mistook in WAR's URL. the correct is
> http://www.gapo.cz/download/genusinum.war
> <http://www.gapo.cz/downloads/genusinum.war>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: LinkSubmit doesn't work
Posted by Radek Terber <te...@b2bcentrum.cz>.
I'm sorry, I mistook in WAR's URL. the correct is
http://www.gapo.cz/download/genusinum.war
<http://www.gapo.cz/downloads/genusinum.war>
Re: LinkSubmit doesn't work
Posted by paha <ch...@yahoo.com>.
try to change onsubmit.call(window.document, event) to
onsubmit.call(window.document, event) == undefined
--
View this message in context: http://old.nabble.com/LinkSubmit-doesn%27t-work-tp28813499p28814310.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: LinkSubmit doesn't work
Posted by Paul Stanton <pa...@mapshed.com.au>.
https://issues.apache.org/jira/browse/TAP5-1180
Paul Stanton wrote:
> After stepping through the javascript, I believe it's because the
> onsubmit event handler for the form is
> "javascript:Tapestry.waitForPage(event);" who's first line is "if
> (Tapestry.pageLoaded) return;".
>
> This is the equivalent of "if (Tapestry.pageLoaded) return false;"
> when evaluated to a boolean as it is in the LinkSubmit onClick handler:
>
> if (onsubmit == undefined || onsubmit.call(window.document, event))
> {
> this.createHidden();
> this.form.submit();
> }
>
> .. and therefore "this.form.submit();" is never called.
>
> Obviously this is a bug, I'm pretty sure the resolution would be to
> change Tapestry.waitForPage so that it returns true if the page is
> loaded and false otherwise, ie:
>
> waitForPage : function(event)
> {
> if (Tapestry.pageLoaded) return true;
> ...
> return false;
> }
>
> This will allow 'waitForPage' to be evaluated to a boolean as it is in
> LinkSubmit.onClick.
>
> p.
>
> Paul Stanton wrote:
>> Hi,
>>
>> I'm guessing I'm doing something wrong but it's hardly obvious. I
>> have a Form, with a LinkSubmit and a Submit:
>>
>> <t:form t:id="myForm">
>> <t:linksubmit t:id="myLink">link</t:linksubmit>
>> <t:submit t:id="mySubmit" />
>> </t:form>
>>
>> public void onSuccessFromMyForm()
>> {
>> LOG.debug("onSuccessFromMyForm");
>> }
>>
>> public void onSelectedFromMyLink()
>> {
>> LOG.debug("onSelectedFromMyLink");
>> }
>>
>> public void onSelectedFromMySubmit()
>> {
>> LOG.debug("onSelectedFromMySubmit");
>> }
>>
>>
>> The form is submitted and the listener(s) are called when I click the
>> submit, however nothing all all happens when I click the link.
>>
>> p.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: LinkSubmit doesn't work
Posted by Paul Stanton <pa...@mapshed.com.au>.
After stepping through the javascript, I believe it's because the
onsubmit event handler for the form is
"javascript:Tapestry.waitForPage(event);" who's first line is "if
(Tapestry.pageLoaded) return;".
This is the equivalent of "if (Tapestry.pageLoaded) return false;" when
evaluated to a boolean as it is in the LinkSubmit onClick handler:
if (onsubmit == undefined || onsubmit.call(window.document, event))
{
this.createHidden();
this.form.submit();
}
.. and therefore "this.form.submit();" is never called.
Obviously this is a bug, I'm pretty sure the resolution would be to
change Tapestry.waitForPage so that it returns true if the page is
loaded and false otherwise, ie:
waitForPage : function(event)
{
if (Tapestry.pageLoaded) return true;
...
return false;
}
This will allow 'waitForPage' to be evaluated to a boolean as it is in
LinkSubmit.onClick.
p.
Paul Stanton wrote:
> Hi,
>
> I'm guessing I'm doing something wrong but it's hardly obvious. I have
> a Form, with a LinkSubmit and a Submit:
>
> <t:form t:id="myForm">
> <t:linksubmit t:id="myLink">link</t:linksubmit>
> <t:submit t:id="mySubmit" />
> </t:form>
>
> public void onSuccessFromMyForm()
> {
> LOG.debug("onSuccessFromMyForm");
> }
>
> public void onSelectedFromMyLink()
> {
> LOG.debug("onSelectedFromMyLink");
> }
>
> public void onSelectedFromMySubmit()
> {
> LOG.debug("onSelectedFromMySubmit");
> }
>
>
> The form is submitted and the listener(s) are called when I click the
> submit, however nothing all all happens when I click the link.
>
> p.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>