You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Mika Salminen (JIRA)" <ji...@apache.org> on 2007/12/16 21:32:43 UTC

[jira] Created: (WICKET-1231) Fast multiple clicks on Link bound on non- element causes error.

Fast multiple clicks on Link bound on non-<A> element causes error.
-------------------------------------------------------------------

                 Key: WICKET-1231
                 URL: https://issues.apache.org/jira/browse/WICKET-1231
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.0-rc2
         Environment: Tomcat 6, Firefox 2.0.0.11, Linux
            Reporter: Mika Salminen
            Priority: Minor


When you attach a link component to some other element that <A>, fast clicking on the element causes usually errors.

This issue can be demonstrated for example by creating link on table cell with html code:
...
<tr>
	<td wicket:id="alink"
	style="width: 100px; height: 100px; background-color: red;">alink</td>
</tr>
...

and Java code:
...
add(new Link("alink") {
	public void onClick() {
		setResponsePage(TestPage.class);
	};
});
...

Now if you for example double-click the link you will probably get HTTP 404 or some other error.

I think that the problem is caused by the onclick event processing and relative urls.

For example by double-clicking a link, two onclick events are fired. First event sets the window.location.href to correct address appending the relative url "ExamplePage/param1/val1" to current url. Second event appends the "ExamplePage/param1/val1" again and now the resultant address is incorrect "ExamplePage/param1/val1/ExamplePage/param1/val1".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-1231) Fast multiple clicks on Link bound on non- element causes error.

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

Johan Compagner reassigned WICKET-1231:
---------------------------------------

    Assignee: Matej Knopp

just checked in a fix that seems to work for FF and IE
Matej is checking some more.

> Fast multiple clicks on Link bound on non-<A> element causes error.
> -------------------------------------------------------------------
>
>                 Key: WICKET-1231
>                 URL: https://issues.apache.org/jira/browse/WICKET-1231
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Tomcat 6, Firefox 2.0.0.11, Linux
>            Reporter: Mika Salminen
>            Assignee: Matej Knopp
>            Priority: Minor
>         Attachments: testapp-src.zip, TestApp.war
>
>
> When you attach a link component to some other element that <A>, fast clicking on the element causes usually errors.
> This issue can be demonstrated for example by creating link on table cell with html code:
> ...
> <tr>
> 	<td wicket:id="alink"
> 	style="width: 100px; height: 100px; background-color: red;">alink</td>
> </tr>
> ...
> and Java code:
> ...
> add(new Link("alink") {
> 	public void onClick() {
> 		setResponsePage(TestPage.class);
> 	};
> });
> ...
> Now if you for example double-click the link you will probably get HTTP 404 or some other error.
> I think that the problem is caused by the onclick event processing and relative urls.
> For example by double-clicking a link, two onclick events are fired. First event sets the window.location.href to correct address appending the relative url "ExamplePage/param1/val1" to current url. Second event appends the "ExamplePage/param1/val1" again and now the resultant address is incorrect "ExamplePage/param1/val1/ExamplePage/param1/val1".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1231) Fast multiple clicks on Link bound on non- element causes error.

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552360 ] 

Johan Compagner commented on WICKET-1231:
-----------------------------------------

How do you double click?
Do you wait first for the page to be loaded?
Else you would click on the exact same url and that url is something like: "wicket:interface=xxxxx"

You say you fast click. So i guess you dont wait, and the only thing you do is set a next page. 
That should just be done just twice. You don't rerender the same page after the click so that page is not changed
somehow so the second link click should just find the page again.
So i don't see what can go wrong in your situation please attach a quickstart app to this issue.


> Fast multiple clicks on Link bound on non-<A> element causes error.
> -------------------------------------------------------------------
>
>                 Key: WICKET-1231
>                 URL: https://issues.apache.org/jira/browse/WICKET-1231
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Tomcat 6, Firefox 2.0.0.11, Linux
>            Reporter: Mika Salminen
>            Priority: Minor
>
> When you attach a link component to some other element that <A>, fast clicking on the element causes usually errors.
> This issue can be demonstrated for example by creating link on table cell with html code:
> ...
> <tr>
> 	<td wicket:id="alink"
> 	style="width: 100px; height: 100px; background-color: red;">alink</td>
> </tr>
> ...
> and Java code:
> ...
> add(new Link("alink") {
> 	public void onClick() {
> 		setResponsePage(TestPage.class);
> 	};
> });
> ...
> Now if you for example double-click the link you will probably get HTTP 404 or some other error.
> I think that the problem is caused by the onclick event processing and relative urls.
> For example by double-clicking a link, two onclick events are fired. First event sets the window.location.href to correct address appending the relative url "ExamplePage/param1/val1" to current url. Second event appends the "ExamplePage/param1/val1" again and now the resultant address is incorrect "ExamplePage/param1/val1/ExamplePage/param1/val1".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-1231) Fast multiple clicks on Link bound on non- element causes error.

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

Mika Salminen updated WICKET-1231:
----------------------------------

    Attachment: testapp-src.zip
                TestApp.war

Test app and source to demonstrate the issue.

> Fast multiple clicks on Link bound on non-<A> element causes error.
> -------------------------------------------------------------------
>
>                 Key: WICKET-1231
>                 URL: https://issues.apache.org/jira/browse/WICKET-1231
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Tomcat 6, Firefox 2.0.0.11, Linux
>            Reporter: Mika Salminen
>            Priority: Minor
>         Attachments: testapp-src.zip, TestApp.war
>
>
> When you attach a link component to some other element that <A>, fast clicking on the element causes usually errors.
> This issue can be demonstrated for example by creating link on table cell with html code:
> ...
> <tr>
> 	<td wicket:id="alink"
> 	style="width: 100px; height: 100px; background-color: red;">alink</td>
> </tr>
> ...
> and Java code:
> ...
> add(new Link("alink") {
> 	public void onClick() {
> 		setResponsePage(TestPage.class);
> 	};
> });
> ...
> Now if you for example double-click the link you will probably get HTTP 404 or some other error.
> I think that the problem is caused by the onclick event processing and relative urls.
> For example by double-clicking a link, two onclick events are fired. First event sets the window.location.href to correct address appending the relative url "ExamplePage/param1/val1" to current url. Second event appends the "ExamplePage/param1/val1" again and now the resultant address is incorrect "ExamplePage/param1/val1/ExamplePage/param1/val1".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-1231) Fast multiple clicks on Link bound on non- element causes error.

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

Matej Knopp resolved WICKET-1231.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.0-final

This should be already fixed. 

> Fast multiple clicks on Link bound on non-<A> element causes error.
> -------------------------------------------------------------------
>
>                 Key: WICKET-1231
>                 URL: https://issues.apache.org/jira/browse/WICKET-1231
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Tomcat 6, Firefox 2.0.0.11, Linux
>            Reporter: Mika Salminen
>            Assignee: Matej Knopp
>            Priority: Minor
>             Fix For: 1.3.0-final
>
>         Attachments: testapp-src.zip, TestApp.war
>
>
> When you attach a link component to some other element that <A>, fast clicking on the element causes usually errors.
> This issue can be demonstrated for example by creating link on table cell with html code:
> ...
> <tr>
> 	<td wicket:id="alink"
> 	style="width: 100px; height: 100px; background-color: red;">alink</td>
> </tr>
> ...
> and Java code:
> ...
> add(new Link("alink") {
> 	public void onClick() {
> 		setResponsePage(TestPage.class);
> 	};
> });
> ...
> Now if you for example double-click the link you will probably get HTTP 404 or some other error.
> I think that the problem is caused by the onclick event processing and relative urls.
> For example by double-clicking a link, two onclick events are fired. First event sets the window.location.href to correct address appending the relative url "ExamplePage/param1/val1" to current url. Second event appends the "ExamplePage/param1/val1" again and now the resultant address is incorrect "ExamplePage/param1/val1/ExamplePage/param1/val1".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-1231) Fast multiple clicks on Link bound on non- element causes error.

Posted by "Mika Salminen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552522 ] 

Mika Salminen commented on WICKET-1231:
---------------------------------------

Issue seems to be less general than what I assumed. Link is on a mounted page with HybridUrlEncodingStrategy. Also the link is on a page which was requested with url parameters.

In the app I am developing the error was given on every double-click, but in the attached test app you might have to try a couple of times to find the right click "frequency" or try triple-click. It should be quite easy to reproduce even with this app. Hope you get the problem.

I guess that this is more of a browser issue and is caused by the url format which has parts separated with slashes "/root/aaa/bbb/ccc". Relative url with format wicket:interface=xxxxx referenced from url /MyApp/ becomes absolute url /MyApp/wicket:interface=xxxxx and if it is referenced again from url /MyApp/wicket:interface=xxxxx firefox just rips of the last part and appends the relative url wicket:interface=xxxxx and so the second reference is also handled right to be absolute url /MyApp/wicket:interface=xxxxx.

But when you are using url format with slashes firefox handles the second event (caused by clicking the link twice) so that the absolute url is invalid. When you click for the first time link on a page with with url /MyApp/TestPage/param1/val1/.0 a request to interface at relative url  "../../../?wicket:interface=xxxxx" is made which translates to absolute url /MyApp/?wicket:interface=xxxxx. But when the relative url is referenced again on the second event it translates into something like "/MyApp/TargetPage/../../../?wicket:interface=xxxxx" which firefox interprets as absolute url "/?wicket:interface=xxxxx" that does not even have the context part in the beginning and thus gives 404 error.


> Fast multiple clicks on Link bound on non-<A> element causes error.
> -------------------------------------------------------------------
>
>                 Key: WICKET-1231
>                 URL: https://issues.apache.org/jira/browse/WICKET-1231
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-rc2
>         Environment: Tomcat 6, Firefox 2.0.0.11, Linux
>            Reporter: Mika Salminen
>            Priority: Minor
>         Attachments: testapp-src.zip, TestApp.war
>
>
> When you attach a link component to some other element that <A>, fast clicking on the element causes usually errors.
> This issue can be demonstrated for example by creating link on table cell with html code:
> ...
> <tr>
> 	<td wicket:id="alink"
> 	style="width: 100px; height: 100px; background-color: red;">alink</td>
> </tr>
> ...
> and Java code:
> ...
> add(new Link("alink") {
> 	public void onClick() {
> 		setResponsePage(TestPage.class);
> 	};
> });
> ...
> Now if you for example double-click the link you will probably get HTTP 404 or some other error.
> I think that the problem is caused by the onclick event processing and relative urls.
> For example by double-clicking a link, two onclick events are fired. First event sets the window.location.href to correct address appending the relative url "ExamplePage/param1/val1" to current url. Second event appends the "ExamplePage/param1/val1" again and now the resultant address is incorrect "ExamplePage/param1/val1/ExamplePage/param1/val1".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.