Hi, Thorsten
This is correct behavior. Tapestry pages are shared across all requests,
so User object will be the same. you need to add some code like follow:
@Persist
@Property
private User user;
@OnEvent(Form.PREPARE)
void prepare() {
if (user == null) {
user = new User();
}
}
Thorsten Castor wrote:
Hi,
we just figured out that properties which are instantiated directly
will be shared between sessions on the same server.
So if you start the example app on two browsers and type some text in
the textfield of the first browser, hit enter and reload on the second
browser you will see the content here as well. If the property is
instantiated lazy in a getter or any other method the content won't be
shared.
I tested it with 5.0.11, 5.0.12-SNAPSHOT and 5.0.13-SNAPSHOT on
jetty-6.1.9 and tomcat-6.0.13.
I'm quite new to the list so was this problem discussed before or is
it a bug?
Here the example I used:
public class Index {
@Persist
@Property
private User user = new User();
@Component(id="textField", parameters={"value=user.name"})
private TextField textField;
}
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<head></head>
<body>
<t:form>
<t:textfield t:id="textField"/>
</t:form>
</body>
</html>
public class User {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]