Hi All
I’m going through the addressbook app and I’ve the following issue. The PostalCode in Person.java is by default ‘null’ (its an Integer).
Now, when I want to create a new Person, the PersonForm puts ‘null’ in the text field.
All the other fields are set to “” and don’t have this problem:
public class Person implements Serializable {
private String firstName = "";
private String lastName = "";
private String email = "";
private String phoneNumber = "";
private String streetAddress = "";
private Integer postalCode = null;
private String city = "";
........
What can I do so the texfield is empty instead of showing ‘null’ for the postal code?
cheers
jeanluca
ps To create a new Person, the PersonForm does the following:
public void addContact() {
// Create a temporary item for the form
newPerson = new Person();
setItemDataSource(new BeanItem(newPerson));
newContactMode = true;
setReadOnly(false);
}