Hi,
I investigated a little bit and I found that it happened only for
HttpSessionStore:
This is my test application:
public class TestApplication extends WebApplication {
@Override
public Class<? extends Page> getHomePage() {
return TestPage.class;
}
@Override
protected void init() {
super.init();
mount(new HybridUrlCodingStrategy("/test", TestPage.class));
}
@Override
protected ISessionStore newSessionStore() {
return new HttpSessionStore(this);
}
}
The whole application is here: http://web.loose.cz/wicket/test.zip (maven
+ war)
It is broken for Apache Tomcat 7 (Development) and for IBM WebSphere
(Production) too, so it is not problem of one application server.
The steps needed to reproduction:
1. open browser
2. go to http://localhost:8080/test-1.0/test
3. open new tab
4. go to http://localhost:8080/test-1.0/test
5. click to submit
6. swicth to first tab
7. click to submit -> nothing happened
8. click to link -> it works
9. click to submit -> now it works too
10. go to second tab -> submit/link work fine
Br,
Jan
On Thu, 24 Nov 2011 16:50:37 +0100, Dan Retzlaff <dretzl...@gmail.com>
wrote:
Hi, Jan. Your code looks okay to me. I tested in Chrome myself using
1.4.18
and 1.4.19 and was not able to reproduce your problem.
On Thu, Nov 24, 2011 at 1:08 AM, Jan Loose
<jan.lo...@cleverlance.com>wrote:
Hello,
we are using Wicket 1.4.18 and we found a problem if we open two pages
then the AjaxLink works great but the AjaxSubmitLink doesn't. The page
is
mounted by HybridUrlCodingStrategy, but I've tried the normal
bookmarkable
mount and the behavior is the same. I've created a simple page, that
demonstrates the problem.
public class TestPage extends WebPage {
private String input;
public TestPage() {
Form<Void> form;
add(form = new Form<Void>("form"));
final TextField<String> inputField = new
TextField<String>("input",
new PropertyModel<String>(this, "input"));
form.add(inputField.**setOutputMarkupId(true));
form.add(new AjaxSubmitLink("submit") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?>
form)
{
input = "submit " + Math.random();
target.addComponent(**inputField);
}
});
form.add(new AjaxLink<Void>("link") {
@Override
public void onClick(AjaxRequestTarget target) {
input = "link " + Math.random();
target.addComponent(**inputField);
}
});
}
public String getInput() {
return input;
}
public void setInput(String input) {
this.input = input;
}
}
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/**DTD/xhtml1-strict.dtd<http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
">
<html xmlns="http://www.w3.org/1999/**xhtml
<http://www.w3.org/1999/xhtml>"
xmlns:wicket="http://wicket.**apache.org/dtds.data/wicket-**
xhtml1.4-strict.dtd<http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd>
">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>TestPage</title>
</head>
<body>
<form wicket:id="form">
<div>
<input wicket:id="input"/>
<a wicket:id="submit">submit</a>
<a wicket:id="link">link</a>
</div>
</form>
</body>
</html>
Just open the page in two tabs in one browser (I've tested it in Opera
and
Chrome). In the first tab click to the submit link (AjaxSubmitLink) and
then switch to the second page and click to the submit link too. Nothing
happened. I investigated there is used EmptyAjaxRequestTarget, but I'm
not
sure why, because if try the same scenario using the second link
(AjaxLink)
then it works fine.
Where is the problem? What am I doing wrong? How can I solve this
problem?
Best regards,
Jan
--
Jan Loose
J2EE Team Leader / Senior J2EE Developer
_____________________________________________
Cleverlance – CREATE IT
člen Cleverlance Group
www.cleverlance.com
Dukelských hrdinů 34
170 00 Praha 7
Czech Republic
Tel: +420 266 177 166
Mobil: +420 777 788 078