StrataFrame Forum

Listview Interface automation problem

http://forum.strataframe.net/Topic20279.aspx

By GRocchi - 10/23/2008

In regard to the new listview population features added in version 1.6.6 I found a little problem

I have a form with a listview populated with a businessobject and a child form to edit the business object.
I also have a button bound to the AddObject property. When I click this button the child form correctly shows up and I can add the record.
When I close the childform Strataframe pops up a message asking me whether I want to save the changes or no. I answer NO and When I return to the parent form the row is added to the list nonetheless.

If I check the businessobject content I find that the row is in fact present (however it is not saved to the database, nor it will be saved on a .save method)

How can I avoid this behavior, given that almost all of this is automatically managed by strataframe?(i.e. I have not written any source code)

By Trent L. Taylor - 10/23/2008

Just set the AutoSHowSaveChanges message to False on the child form.
By GRocchi - 10/23/2008

Thankyou Trent,

but the matter is that the record is added to the BO also if the user press NO. Is this a correct behavior?

The question isn't about showing or not the confirmation dialog, it's about the fact that the user can't prevent the record just edited to be added to the BO.

By Trent L. Taylor - 10/23/2008

Yes, this is correct.  If you are using the ChildFormDialog, that means that you are translating the parent form object to the child.  If you are using the ListView, then you need to handle the ChildFormResults event, and call the BO.RestoreFromSnapShot() method to undo the record.  Please look at the StrataFlix sample for an example of this.
By GRocchi - 10/23/2008

Ok, Thank you Taylor.