Hi,
I just begin to learn T5 and simply use component t:beaneditform to create/edit
a simple entity User. But I found that the validation behavior are different in
IE6 and firefox.
Please help. My tapestry version is 5.0.11.
My entity code:
public class User implements Serializable {
private String username;
private String password;
@Validate("required") // for tapestry, add require validation.
public String getPassword() {
return password;
}
// other setter & getter
}
My page class code:
public class CreateUser extends BasePage { // my base page to inject the entity
service
private User user; // not persistent
public User getUser() {
return this.user;
}
public void setUser(User user) {
this.user = user;
}
@InjectPage
private UserList listPage;
UserList onActionFromUsereditor() {
getEntityService().save(user);
return this.listPage;
}
}
I don't write any validation in page class, such as onSuccess ...
My template code:
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<head>
<title>t5first Start Page</title>
</head>
<body>
<h1>Create User</h1>
<t:beaneditform t:id="usereditor" t:object="user"
t:submitLabel="message:button.save"/>
</body>
</html>
Case: I input nothing, and click "submit" button.
In firefox everything works. A ajax request is sent, later a popup prompt that
"password" can't be null.
But in IE6(I have installed VS2005 studio as debugger), when I click "submit"
button, a js error happens: Object doesn't support this property or method and
ask me whether to debug or not.
I choose not, then the "onActionFromUsereditor" is invoked and page navigates
to the user list page. An user record has been added to DB!!!.
Would you please help?
BTW, T4's client validation is very good without sending ajax request, is there
a way for T5 to implement such feature?
Thanks!
DH