You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Nick Westgate (JIRA)" <ta...@jakarta.apache.org> on 2005/06/13 11:54:47 UTC

[jira] Created: (TAPESTRY-339) LinkSubmit can cause browser back button problems

LinkSubmit can cause browser back button problems
-------------------------------------------------

         Key: TAPESTRY-339
         URL: http://issues.apache.org/jira/browse/TAPESTRY-339
     Project: Tapestry
        Type: Bug
 Environment: Any
    Reporter: Nick Westgate
    Priority: Minor


If LinkSubmit is mixed with other submit components in the same form, erroneous submits can occur from pages accessed via the browser back button. This happens because LinkSubmit's hidden variable is never reset.

Suggested fix (line marked +++) in LinkSubmit.java, renderComponent method:

                // make sure the submit function is on the page (once)
                if (cycle.getAttribute(ATTRIBUTE_FUNCTION_NAME) == null)
                {
+++                 body.addInitializationScript("document." + formName + "._linkSubmit.value = null;");
                    body.addBodyScript(
                        "function submitLink(form, elementId) { form._linkSubmit.value = elementId; if (form.onsubmit == null || form.onsubmit()) form.submit(); }");
                    cycle.setAttribute(ATTRIBUTE_FUNCTION_NAME, this);
                }

It would be great if the corrected LinkSubmit submission mechanism detail was factored out into a separate class, so that other submit components could be built using it. For example, Glen Stampoultzis's ButtonSubmit component.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Re: [jira] Updated: (TAPESTRY-339) LinkSubmit can cause browser back button problems

Posted by "Brian K. Wallace" <br...@transmorphix.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks Jesse! [One more in the 3.0.4 pile :-)]

Jesse Kuhnert (JIRA) wrote:
>      [ http://issues.apache.org/jira/browse/TAPESTRY-339?page=all ]
> 
> Jesse Kuhnert updated TAPESTRY-339:
> -----------------------------------
> 
>     Fix Version: 3.0.4
>         Version: 3.0.3
> 
>> LinkSubmit can cause browser back button problems
>> -------------------------------------------------
>>
>>          Key: TAPESTRY-339
>>          URL: http://issues.apache.org/jira/browse/TAPESTRY-339
>>      Project: Tapestry
>>         Type: Bug
>>     Versions: 3.0.3
>>  Environment: Any
>>     Reporter: Nick Westgate
>>     Assignee: Jesse Kuhnert
>>     Priority: Minor
>>      Fix For: 3.0.4
> 
>> If LinkSubmit is mixed with other submit components in the same form, erroneous submits can occur from pages accessed via the browser back button. This happens because LinkSubmit's hidden variable is never reset.
>> Suggested fix (line marked +++) in LinkSubmit.java, renderComponent method:
>>                 // make sure the submit function is on the page (once)
>>                 if (cycle.getAttribute(ATTRIBUTE_FUNCTION_NAME) == null)
>>                 {
>> +++                 body.addInitializationScript("document." + formName + "._linkSubmit.value = null;");
>>                     body.addBodyScript(
>>                         "function submitLink(form, elementId) { form._linkSubmit.value = elementId; if (form.onsubmit == null || form.onsubmit()) form.submit(); }");
>>                     cycle.setAttribute(ATTRIBUTE_FUNCTION_NAME, this);
>>                 }
>> It would be great if the corrected LinkSubmit submission mechanism detail was factored out into a separate class, so that other submit components could be built using it. For example, Glen Stampoultzis's ButtonSubmit component.
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)

iD8DBQFEKBIuaCoPKRow/gARAtPYAJ4zCtIkf2A4EOEHW34Qm57DWLDOZACfWGFa
lolp+zIB20Yq3Ing/I6et3s=
=Pn5Z
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Updated: (TAPESTRY-339) LinkSubmit can cause browser back button problems

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-339?page=all ]

Jesse Kuhnert updated TAPESTRY-339:
-----------------------------------

    Fix Version: 3.0.4
        Version: 3.0.3

> LinkSubmit can cause browser back button problems
> -------------------------------------------------
>
>          Key: TAPESTRY-339
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-339
>      Project: Tapestry
>         Type: Bug
>     Versions: 3.0.3
>  Environment: Any
>     Reporter: Nick Westgate
>     Assignee: Jesse Kuhnert
>     Priority: Minor
>      Fix For: 3.0.4

>
> If LinkSubmit is mixed with other submit components in the same form, erroneous submits can occur from pages accessed via the browser back button. This happens because LinkSubmit's hidden variable is never reset.
> Suggested fix (line marked +++) in LinkSubmit.java, renderComponent method:
>                 // make sure the submit function is on the page (once)
>                 if (cycle.getAttribute(ATTRIBUTE_FUNCTION_NAME) == null)
>                 {
> +++                 body.addInitializationScript("document." + formName + "._linkSubmit.value = null;");
>                     body.addBodyScript(
>                         "function submitLink(form, elementId) { form._linkSubmit.value = elementId; if (form.onsubmit == null || form.onsubmit()) form.submit(); }");
>                     cycle.setAttribute(ATTRIBUTE_FUNCTION_NAME, this);
>                 }
> It would be great if the corrected LinkSubmit submission mechanism detail was factored out into a separate class, so that other submit components could be built using it. For example, Glen Stampoultzis's ButtonSubmit component.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Resolved: (TAPESTRY-339) LinkSubmit can cause browser back button problems

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-339?page=all ]
     
Jesse Kuhnert resolved TAPESTRY-339:
------------------------------------

    Resolution: Fixed

Applied to 3.0.4

> LinkSubmit can cause browser back button problems
> -------------------------------------------------
>
>          Key: TAPESTRY-339
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-339
>      Project: Tapestry
>         Type: Bug
>     Versions: 3.0.3
>  Environment: Any
>     Reporter: Nick Westgate
>     Assignee: Jesse Kuhnert
>     Priority: Minor
>      Fix For: 3.0.4

>
> If LinkSubmit is mixed with other submit components in the same form, erroneous submits can occur from pages accessed via the browser back button. This happens because LinkSubmit's hidden variable is never reset.
> Suggested fix (line marked +++) in LinkSubmit.java, renderComponent method:
>                 // make sure the submit function is on the page (once)
>                 if (cycle.getAttribute(ATTRIBUTE_FUNCTION_NAME) == null)
>                 {
> +++                 body.addInitializationScript("document." + formName + "._linkSubmit.value = null;");
>                     body.addBodyScript(
>                         "function submitLink(form, elementId) { form._linkSubmit.value = elementId; if (form.onsubmit == null || form.onsubmit()) form.submit(); }");
>                     cycle.setAttribute(ATTRIBUTE_FUNCTION_NAME, this);
>                 }
> It would be great if the corrected LinkSubmit submission mechanism detail was factored out into a separate class, so that other submit components could be built using it. For example, Glen Stampoultzis's ButtonSubmit component.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Closed: (TAPESTRY-339) LinkSubmit can cause browser back button problems

Posted by "Brian K. Wallace (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-339?page=all ]
     
Brian K. Wallace closed TAPESTRY-339:
-------------------------------------


> LinkSubmit can cause browser back button problems
> -------------------------------------------------
>
>          Key: TAPESTRY-339
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-339
>      Project: Tapestry
>         Type: Bug

>     Versions: 3.0.3
>  Environment: Any
>     Reporter: Nick Westgate
>     Assignee: Jesse Kuhnert
>     Priority: Minor
>      Fix For: 3.0.4

>
> If LinkSubmit is mixed with other submit components in the same form, erroneous submits can occur from pages accessed via the browser back button. This happens because LinkSubmit's hidden variable is never reset.
> Suggested fix (line marked +++) in LinkSubmit.java, renderComponent method:
>                 // make sure the submit function is on the page (once)
>                 if (cycle.getAttribute(ATTRIBUTE_FUNCTION_NAME) == null)
>                 {
> +++                 body.addInitializationScript("document." + formName + "._linkSubmit.value = null;");
>                     body.addBodyScript(
>                         "function submitLink(form, elementId) { form._linkSubmit.value = elementId; if (form.onsubmit == null || form.onsubmit()) form.submit(); }");
>                     cycle.setAttribute(ATTRIBUTE_FUNCTION_NAME, this);
>                 }
> It would be great if the corrected LinkSubmit submission mechanism detail was factored out into a separate class, so that other submit components could be built using it. For example, Glen Stampoultzis's ButtonSubmit component.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Resolved: (TAPESTRY-339) LinkSubmit can cause browser back button problems

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-339?page=all ]
     
Howard M. Lewis Ship resolved TAPESTRY-339:
-------------------------------------------

    Resolution: Duplicate
     Assign To: Howard M. Lewis Ship

> LinkSubmit can cause browser back button problems
> -------------------------------------------------
>
>          Key: TAPESTRY-339
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-339
>      Project: Tapestry
>         Type: Bug
>  Environment: Any
>     Reporter: Nick Westgate
>     Assignee: Howard M. Lewis Ship
>     Priority: Minor

>
> If LinkSubmit is mixed with other submit components in the same form, erroneous submits can occur from pages accessed via the browser back button. This happens because LinkSubmit's hidden variable is never reset.
> Suggested fix (line marked +++) in LinkSubmit.java, renderComponent method:
>                 // make sure the submit function is on the page (once)
>                 if (cycle.getAttribute(ATTRIBUTE_FUNCTION_NAME) == null)
>                 {
> +++                 body.addInitializationScript("document." + formName + "._linkSubmit.value = null;");
>                     body.addBodyScript(
>                         "function submitLink(form, elementId) { form._linkSubmit.value = elementId; if (form.onsubmit == null || form.onsubmit()) form.submit(); }");
>                     cycle.setAttribute(ATTRIBUTE_FUNCTION_NAME, this);
>                 }
> It would be great if the corrected LinkSubmit submission mechanism detail was factored out into a separate class, so that other submit components could be built using it. For example, Glen Stampoultzis's ButtonSubmit component.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Reopened: (TAPESTRY-339) LinkSubmit can cause browser back button problems

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-339?page=all ]
     
Jesse Kuhnert reopened TAPESTRY-339:
------------------------------------

     Assign To: Jesse Kuhnert  (was: Howard M. Lewis Ship)

> LinkSubmit can cause browser back button problems
> -------------------------------------------------
>
>          Key: TAPESTRY-339
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-339
>      Project: Tapestry
>         Type: Bug
>  Environment: Any
>     Reporter: Nick Westgate
>     Assignee: Jesse Kuhnert
>     Priority: Minor

>
> If LinkSubmit is mixed with other submit components in the same form, erroneous submits can occur from pages accessed via the browser back button. This happens because LinkSubmit's hidden variable is never reset.
> Suggested fix (line marked +++) in LinkSubmit.java, renderComponent method:
>                 // make sure the submit function is on the page (once)
>                 if (cycle.getAttribute(ATTRIBUTE_FUNCTION_NAME) == null)
>                 {
> +++                 body.addInitializationScript("document." + formName + "._linkSubmit.value = null;");
>                     body.addBodyScript(
>                         "function submitLink(form, elementId) { form._linkSubmit.value = elementId; if (form.onsubmit == null || form.onsubmit()) form.submit(); }");
>                     cycle.setAttribute(ATTRIBUTE_FUNCTION_NAME, this);
>                 }
> It would be great if the corrected LinkSubmit submission mechanism detail was factored out into a separate class, so that other submit components could be built using it. For example, Glen Stampoultzis's ButtonSubmit component.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Commented: (TAPESTRY-339) LinkSubmit can cause browser back button problems

Posted by "Nick Westgate (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-339?page=comments#action_12313562 ] 

Nick Westgate commented on TAPESTRY-339:
----------------------------------------

Oops. Damn Mondays ... the line (+++) should go in this block:

                // one hidden field per form:
                String formHiddenFieldAttributeName = ATTRIBUTE_FUNCTION_NAME + formName;
                if (cycle.getAttribute(formHiddenFieldAttributeName) == null)
                {
+++                 body.addInitializationScript("document." + formName + "._linkSubmit.value = null;");
                    writer.beginEmpty("input");
                    writer.attribute("type", "hidden");
                    writer.attribute("name", "_linkSubmit");
                    cycle.setAttribute(formHiddenFieldAttributeName, this);
                }


> LinkSubmit can cause browser back button problems
> -------------------------------------------------
>
>          Key: TAPESTRY-339
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-339
>      Project: Tapestry
>         Type: Bug
>  Environment: Any
>     Reporter: Nick Westgate
>     Priority: Minor

>
> If LinkSubmit is mixed with other submit components in the same form, erroneous submits can occur from pages accessed via the browser back button. This happens because LinkSubmit's hidden variable is never reset.
> Suggested fix (line marked +++) in LinkSubmit.java, renderComponent method:
>                 // make sure the submit function is on the page (once)
>                 if (cycle.getAttribute(ATTRIBUTE_FUNCTION_NAME) == null)
>                 {
> +++                 body.addInitializationScript("document." + formName + "._linkSubmit.value = null;");
>                     body.addBodyScript(
>                         "function submitLink(form, elementId) { form._linkSubmit.value = elementId; if (form.onsubmit == null || form.onsubmit()) form.submit(); }");
>                     cycle.setAttribute(ATTRIBUTE_FUNCTION_NAME, this);
>                 }
> It would be great if the corrected LinkSubmit submission mechanism detail was factored out into a separate class, so that other submit components could be built using it. For example, Glen Stampoultzis's ButtonSubmit component.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org