Your client object is probably null. Make sure it isn't.
Uli
Am 23.04.2009 11:14 schrieb kk4Nabble:
Hi all,
Am learning Tapestry 5.
This is createclient.tml
<form t:type="form" t:id="names" >
<t:errors/>
<table>
<tr>
<td>First Name:</td>
<td><input t:type="TextField" t:id="firstName"
t:value="firstName"/></td>
</tr>
<tr>
<td>Last Name:</td>
<td><input t:type="TextField" t:id="lastName"
t:value="lastName"/></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Save"/></td>
</tr>
</table>
</form>
And createclient.java
public class CreateClient
{
@Property
private String firstName;
@Property
private String lastName;
@Component(id = "names")
private Form form;
@Component(id = "firstName")
private TextField firstNameField;
@Component(id = "lastName")
private TextField lastNameField;
@Property
private Client client;
@Inject
private Session session;
@InjectPage
private Index index;
@CommitAfter
Object onSuccess()
{
client.setFirstName(firstName);
client.setLastName(lastName);
session.persist(client);
return index;
}
}
I have an entity class Client with first name and lastname.
If i don use beaneditform And want to use this form and still store the
value of client in database.
The above method gives null pointer exception .
How do i do that?
Did i miss anything?
Can anyone help me..
Thanks in advance..
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org