Form itemDataSource and HbnContainer

Hi everyone!

I have the following code:

HbnContainer<Survey> cont = new HbnContainer<Survey>(Survey.class, null, new HibernateSession());
int itemId = (Integer) cont.addItem();
EntityItem item = cont.getItem(itemId);
	
generalInfoForm.setItemDataSource(item);
generalInfoForm.setImmediate(true);
generalInfoForm.setFormFieldFactory(new SurveyFieldFactory());

Vector order = new Vector();
order.add("title"); 
		
generalInfoForm.setVisibleItemProperties(order);

And in the new SurveyFieldFactory:

TextField title = new TextField(TM.get("newSurvey.TitleLabel"));
title.setRequired(true);
title.setRequiredError(TM.get("newSurvey.TitleError"));
return title;

The textField is displayed correctly, but as soon as I type something in it, i get a NullPointerException.

I can edit the pojo with the following code:

Survey survey = (Survey) item.getPojo();
survey.setTitle("test");

Any Ideas what the problem is?

Thank you very much!
Kevin