Form saves data on click of cancel button


I have a form which has a text area and a combobox. I also have two readonly fields. when i load the form for edit i prepopulate the form fields. Now the Issue is if the user
Modifies data in the textarea and clicks Cancel button i navigate back to the table view. When i select the same table row for edit i see the data which user entered before clicking cancel button. I call form.discard() on cancel button click. But even then the data is saved in memory. Not sure why this is Happenning any Help.

Have you enabled buffering with setWriteThrough(false) for the form?

No I have not used any setWriteThrough() for my form anywhere.

You should have.

Thanks Marko that worked like charm