You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Christian Oldiges (JIRA)" <ji...@apache.org> on 2012/07/26 14:42:36 UTC

[jira] [Created] (WICKET-4675) Allow the server to control which Ajax channel is used to process ajax responses on a per component basis

Christian Oldiges created WICKET-4675:
-----------------------------------------

             Summary: Allow the server to control which Ajax channel is used to process ajax responses on a per component basis
                 Key: WICKET-4675
                 URL: https://issues.apache.org/jira/browse/WICKET-4675
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
    Affects Versions: 6.0.0-beta3
            Reporter: Christian Oldiges


situation:

- one component is replaced via several ajax channels.
- the processing of the reponse steps of those channels may be interleaved.
- the ajax response may contain DOM replacements (including modified IDs and component paths) and event handler assignments

The correct order for two concurrent ajax requests executed over 2 seperate channels would be:

DOM replacement
event assigment
DOM replacement
event assignment

Currently something like this may happen:

DOM replacement
DOM replacement
event assignment
event assignment

The event assignment fails when the component ids change during the DOM replacement.
Also it is required that the second batch of event assigments is executed after the first batch

Possible solution - Add a new method to assign an Ajax Channel per component for the ajax response:

target.add(component, channel);


This would allow to schedule the response processing to the ajax channel on a per-component basis instead of a per-request/response basis.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4675) Process Ajax responses in one go

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4675.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.0.0

I've testes the stack size of most major browsers and set FunctionsExecuter.depth to 1000. I.e. it will use setTimeout() only if there are more than 1000 functions to execute. That should be enough for any application.

Here are the results of the following test:

<html>
	<head>
		<title>test</title>
		<script>
			var i = 0;
			function go() {
				console.log(i++);
				go();
			};
		</script>
	</head>
	<body onload="go()"></body>
</html>


Chrome, Linux : 24947
Firefox 14, Linux: 5199+ (with many 'unresponsive script' dialogs)
Opera 12.61, Linux: 16382
IE 9: 39324 
IE 7 (browser mode): 5214 
IE 8 (browser mode): 40542 
Safari 5.1.7, Windows: 65532
                
> Process Ajax responses in one go
> --------------------------------
>
>                 Key: WICKET-4675
>                 URL: https://issues.apache.org/jira/browse/WICKET-4675
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Christian Oldiges
>            Assignee: Martin Grigorov
>             Fix For: 6.0.0
>
>
> situation:
> - one component is replaced via several ajax channels.
> - the processing of the reponse steps of those channels may be interleaved.
> - the ajax response may contain DOM replacements (including modified IDs and component paths) and event handler assignments
> The correct order for two concurrent ajax requests executed over 2 seperate channels would be:
> DOM replacement
> event assigment
> DOM replacement
> event assignment
> Currently something like this may happen:
> DOM replacement
> DOM replacement
> event assignment
> event assignment
> The event assignment fails when the component ids change during the DOM replacement.
> Also it is required that the second batch of event assigments is executed after the first batch
> Possible solution - Add a new method to assign an Ajax Channel per component for the ajax response:
> target.add(component, channel);
> This would allow to schedule the response processing to the ajax channel on a per-component basis instead of a per-request/response basis.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (WICKET-4675) Allow the server to control which Ajax channel is used to process ajax responses on a per component basis

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reassigned WICKET-4675:
---------------------------------------

    Assignee: Martin Grigorov
    
> Allow the server to control which Ajax channel is used to process ajax responses on a per component basis
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4675
>                 URL: https://issues.apache.org/jira/browse/WICKET-4675
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Christian Oldiges
>            Assignee: Martin Grigorov
>
> situation:
> - one component is replaced via several ajax channels.
> - the processing of the reponse steps of those channels may be interleaved.
> - the ajax response may contain DOM replacements (including modified IDs and component paths) and event handler assignments
> The correct order for two concurrent ajax requests executed over 2 seperate channels would be:
> DOM replacement
> event assigment
> DOM replacement
> event assignment
> Currently something like this may happen:
> DOM replacement
> DOM replacement
> event assignment
> event assignment
> The event assignment fails when the component ids change during the DOM replacement.
> Also it is required that the second batch of event assigments is executed after the first batch
> Possible solution - Add a new method to assign an Ajax Channel per component for the ajax response:
> target.add(component, channel);
> This would allow to schedule the response processing to the ajax channel on a per-component basis instead of a per-request/response basis.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (WICKET-4675) Allow the server to control which Ajax channel is used to process ajax responses on a per component basis

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reopened WICKET-4675:
-------------------------------------

    
> Allow the server to control which Ajax channel is used to process ajax responses on a per component basis
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4675
>                 URL: https://issues.apache.org/jira/browse/WICKET-4675
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Christian Oldiges
>            Assignee: Martin Grigorov
>
> situation:
> - one component is replaced via several ajax channels.
> - the processing of the reponse steps of those channels may be interleaved.
> - the ajax response may contain DOM replacements (including modified IDs and component paths) and event handler assignments
> The correct order for two concurrent ajax requests executed over 2 seperate channels would be:
> DOM replacement
> event assigment
> DOM replacement
> event assignment
> Currently something like this may happen:
> DOM replacement
> DOM replacement
> event assignment
> event assignment
> The event assignment fails when the component ids change during the DOM replacement.
> Also it is required that the second batch of event assigments is executed after the first batch
> Possible solution - Add a new method to assign an Ajax Channel per component for the ajax response:
> target.add(component, channel);
> This would allow to schedule the response processing to the ajax channel on a per-component basis instead of a per-request/response basis.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4675) Allow the server to control which Ajax channel is used to process ajax responses on a per component basis

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4675.
-------------------------------------

    Resolution: Not A Problem

There were two issues:

1) the formcomponent inputname is just "combo1", not "form:combo1". Sorry about the confusion.
2) You were submitting value "0" which is none of the available ones and thus dropDown.getConvertedInput() returned null, since 0 do not convert to any DomainObject.

Here is the code that works:
@Test
	public void testAjaxDropDownMartin() {
		WicketTester tester= new WicketTester(new WicketApplication());
		tester.startPage(AjaxDropDown.class);
		tester.getRequest().setParameter("combo1", "1");
		tester.executeAjaxEvent("form:combo1", "onchange");
		tester.assertNoErrorMessage();
	}
                
> Allow the server to control which Ajax channel is used to process ajax responses on a per component basis
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4675
>                 URL: https://issues.apache.org/jira/browse/WICKET-4675
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Christian Oldiges
>            Assignee: Martin Grigorov
>
> situation:
> - one component is replaced via several ajax channels.
> - the processing of the reponse steps of those channels may be interleaved.
> - the ajax response may contain DOM replacements (including modified IDs and component paths) and event handler assignments
> The correct order for two concurrent ajax requests executed over 2 seperate channels would be:
> DOM replacement
> event assigment
> DOM replacement
> event assignment
> Currently something like this may happen:
> DOM replacement
> DOM replacement
> event assignment
> event assignment
> The event assignment fails when the component ids change during the DOM replacement.
> Also it is required that the second batch of event assigments is executed after the first batch
> Possible solution - Add a new method to assign an Ajax Channel per component for the ajax response:
> target.add(component, channel);
> This would allow to schedule the response processing to the ajax channel on a per-component basis instead of a per-request/response basis.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4675) Allow the server to control which Ajax channel is used to process ajax responses on a per component basis

Posted by "Christian Oldiges (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425924#comment-13425924 ] 

Christian Oldiges commented on WICKET-4675:
-------------------------------------------

I think, the problem is this part of the FuncitonsExecutor:

                if (this.depth > 50 || Wicket.Browser.isKHTML() || Wicket.Browser.isSafari()) {
                    // to prevent khtml bug that crashes entire browser
                    // or to prevent stack overflow (safari has small call stack)
                    this.depth = 0;
                    window.setTimeout(run, 1);
                } else {
                    this.depth ++;
                    run();
                }
                
> Allow the server to control which Ajax channel is used to process ajax responses on a per component basis
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4675
>                 URL: https://issues.apache.org/jira/browse/WICKET-4675
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Christian Oldiges
>            Assignee: Martin Grigorov
>
> situation:
> - one component is replaced via several ajax channels.
> - the processing of the reponse steps of those channels may be interleaved.
> - the ajax response may contain DOM replacements (including modified IDs and component paths) and event handler assignments
> The correct order for two concurrent ajax requests executed over 2 seperate channels would be:
> DOM replacement
> event assigment
> DOM replacement
> event assignment
> Currently something like this may happen:
> DOM replacement
> DOM replacement
> event assignment
> event assignment
> The event assignment fails when the component ids change during the DOM replacement.
> Also it is required that the second batch of event assigments is executed after the first batch
> Possible solution - Add a new method to assign an Ajax Channel per component for the ajax response:
> target.add(component, channel);
> This would allow to schedule the response processing to the ajax channel on a per-component basis instead of a per-request/response basis.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4675) Process Ajax responses in one go

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov updated WICKET-4675:
------------------------------------

    Attachment: recusrsion.html

Attaching an attempt to make a self-recovering solution for the 'stack overflow' problem that some users experience.

The idea is that when "too much recursion" problem occurs we schedule a setTimeout with the current task so a new stack is created.

Unfortunately only Google Chrome can use it because it seems it uses a combination of 'recursion depth' and stack size to decide when to throw the exception and there is still some space for the additional setTimeout call.

Firefox and IE9 throw the exception when the stack is completely full and thus there is no way to call the additional 'setTimeout' to schedule the next call in the new stack. 
                
> Process Ajax responses in one go
> --------------------------------
>
>                 Key: WICKET-4675
>                 URL: https://issues.apache.org/jira/browse/WICKET-4675
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Christian Oldiges
>            Assignee: Martin Grigorov
>             Fix For: 6.0.0
>
>         Attachments: recusrsion.html
>
>
> situation:
> - one component is replaced via several ajax channels.
> - the processing of the reponse steps of those channels may be interleaved.
> - the ajax response may contain DOM replacements (including modified IDs and component paths) and event handler assignments
> The correct order for two concurrent ajax requests executed over 2 seperate channels would be:
> DOM replacement
> event assigment
> DOM replacement
> event assignment
> Currently something like this may happen:
> DOM replacement
> DOM replacement
> event assignment
> event assignment
> The event assignment fails when the component ids change during the DOM replacement.
> Also it is required that the second batch of event assigments is executed after the first batch
> Possible solution - Add a new method to assign an Ajax Channel per component for the ajax response:
> target.add(component, channel);
> This would allow to schedule the response processing to the ajax channel on a per-component basis instead of a per-request/response basis.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WICKET-4675) Allow the server to control which Ajax channel is used to process ajax responses on a per component basis

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov updated WICKET-4675:
------------------------------------

    Comment: was deleted

(was: There were two issues:

1) the formcomponent inputname is just "combo1", not "form:combo1". Sorry about the confusion.
2) You were submitting value "0" which is none of the available ones and thus dropDown.getConvertedInput() returned null, since 0 do not convert to any DomainObject.

Here is the code that works:
@Test
	public void testAjaxDropDownMartin() {
		WicketTester tester= new WicketTester(new WicketApplication());
		tester.startPage(AjaxDropDown.class);
		tester.getRequest().setParameter("combo1", "1");
		tester.executeAjaxEvent("form:combo1", "onchange");
		tester.assertNoErrorMessage();
	})
    
> Allow the server to control which Ajax channel is used to process ajax responses on a per component basis
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4675
>                 URL: https://issues.apache.org/jira/browse/WICKET-4675
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Christian Oldiges
>            Assignee: Martin Grigorov
>
> situation:
> - one component is replaced via several ajax channels.
> - the processing of the reponse steps of those channels may be interleaved.
> - the ajax response may contain DOM replacements (including modified IDs and component paths) and event handler assignments
> The correct order for two concurrent ajax requests executed over 2 seperate channels would be:
> DOM replacement
> event assigment
> DOM replacement
> event assignment
> Currently something like this may happen:
> DOM replacement
> DOM replacement
> event assignment
> event assignment
> The event assignment fails when the component ids change during the DOM replacement.
> Also it is required that the second batch of event assigments is executed after the first batch
> Possible solution - Add a new method to assign an Ajax Channel per component for the ajax response:
> target.add(component, channel);
> This would allow to schedule the response processing to the ajax channel on a per-component basis instead of a per-request/response basis.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4675) Allow the server to control which Ajax channel is used to process ajax responses on a per component basis

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13426358#comment-13426358 ] 

Martin Grigorov commented on WICKET-4675:
-----------------------------------------

Right. 
With this timeout the processing of an Ajax response may become not-atomic if there are more than 50 steps.
In this case two different Ajax responses may be processes "concurrently" which is something we don't want.

I'll remove this code and test on all major browsers. I guess it was needed for some old version of Safari and Konqueror.
                
> Allow the server to control which Ajax channel is used to process ajax responses on a per component basis
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4675
>                 URL: https://issues.apache.org/jira/browse/WICKET-4675
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Christian Oldiges
>            Assignee: Martin Grigorov
>
> situation:
> - one component is replaced via several ajax channels.
> - the processing of the reponse steps of those channels may be interleaved.
> - the ajax response may contain DOM replacements (including modified IDs and component paths) and event handler assignments
> The correct order for two concurrent ajax requests executed over 2 seperate channels would be:
> DOM replacement
> event assigment
> DOM replacement
> event assignment
> Currently something like this may happen:
> DOM replacement
> DOM replacement
> event assignment
> event assignment
> The event assignment fails when the component ids change during the DOM replacement.
> Also it is required that the second batch of event assigments is executed after the first batch
> Possible solution - Add a new method to assign an Ajax Channel per component for the ajax response:
> target.add(component, channel);
> This would allow to schedule the response processing to the ajax channel on a per-component basis instead of a per-request/response basis.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4675) Process Ajax responses in one go

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov updated WICKET-4675:
------------------------------------

    Summary: Process Ajax responses in one go  (was: Allow the server to control which Ajax channel is used to process ajax responses on a per component basis)
    
> Process Ajax responses in one go
> --------------------------------
>
>                 Key: WICKET-4675
>                 URL: https://issues.apache.org/jira/browse/WICKET-4675
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Christian Oldiges
>            Assignee: Martin Grigorov
>
> situation:
> - one component is replaced via several ajax channels.
> - the processing of the reponse steps of those channels may be interleaved.
> - the ajax response may contain DOM replacements (including modified IDs and component paths) and event handler assignments
> The correct order for two concurrent ajax requests executed over 2 seperate channels would be:
> DOM replacement
> event assigment
> DOM replacement
> event assignment
> Currently something like this may happen:
> DOM replacement
> DOM replacement
> event assignment
> event assignment
> The event assignment fails when the component ids change during the DOM replacement.
> Also it is required that the second batch of event assigments is executed after the first batch
> Possible solution - Add a new method to assign an Ajax Channel per component for the ajax response:
> target.add(component, channel);
> This would allow to schedule the response processing to the ajax channel on a per-component basis instead of a per-request/response basis.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira