views:

15

answers:

0

Hi,

I'm using JSF, Google App Engine, and OpenSessionInView (using Filter and ThreadLocal).

My bean has a private field List<A> allElements; The property getAllElements() retrieves from the database the data, the first time, i.e. when allElements == null.

In the page, I have a dataTable binded with {#MyBean.allElements}.

Finally, there is button "new line", linked to the {#MyBean.newLine} method.

The inputText fields are well initialized but, if I change some value and I click on the "new line" button, the values that I have changed are also altered in the database...

How can I avoid this behavior and have my data saved only when I click on some"save and commit" button ?