StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


12»»

IsDirtyExpand / Collapse
Author
Message
Posted 12/05/2006 11:33:15 AM


StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 07/22/2008 11:48:33 AM
Posts: 23, Visits: 129
In a maintenance form, I have a method to check the IsDirty property of the business object and prompting the user to save changes if IsDirty is true.

If the BO is in edit mode and without making any edits to the bound fields, IsDirty is returning true when I close the form while in edit mode. Is this the desired behavior for IsDirty? Or should I look at another property or method to determine if changes have been made?

Thanks!!

____________________
Programmer/Analyst
Captain D's, LLC

Post #4954
Posted 12/05/2006 12:33:42 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 12:10:08 PM
Posts: 1,327, Visits: 3,471
There is a property for BOs in the Strataframe: Business Layer Settings called SetDirtyOnEdit. My guess is that if you set this to False, then it will only be marked dirty when an actual edit is made. (I haven't messed with it yet, so this is just a guess).
Post #4961
Posted 12/05/2006 12:39:06 PM


StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 07/22/2008 11:48:33 AM
Posts: 23, Visits: 129
That's it. Setting SetDirtyOnEdit to false gave me the desired behavior. Thanks Greg!

____________________
Programmer/Analyst
Captain D's, LLC

Post #4962
Posted 12/05/2006 12:54:07 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 9:49:13 AM
Posts: 4,796, Visits: 4,767
Keep in mind that you can have some side-effects from doing this though.  Your MaintenanceFormToolstrip will not properly reflect your edit mode since the EditingStateChanged event did not change.  Another option here is to turn off the auto-prompting:

MyForm.AutoShowSaveChangesMessage = False

This is another direction.  Just FYI

Post #4964
Posted 12/05/2006 2:24:27 PM


StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 07/22/2008 11:48:33 AM
Posts: 23, Visits: 129
I see now. But setting SetDirtyOnEdit back to true, my toolbar still doesn't get notification. After going into edit mode ALL the buttons disable. How do I get them back?

____________________
Programmer/Analyst
Captain D's, LLC

Post #4974
Posted 12/05/2006 2:27:15 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 9:49:13 AM
Posts: 4,796, Visits: 4,767
If you click the Undo or Save the buttons should be reset if you are using the default IncludeInForm settings.  If you have modified the IncludeInForm settings to determine which BOs are navigated, edited, added, etc. then you can change the behavior of the MaintenanceFormToolstrip.
Post #4975
Posted 12/05/2006 2:35:49 PM


StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 07/22/2008 11:48:33 AM
Posts: 23, Visits: 129
Once I click Edit, ALL the buttons are disabled including Save and Undo.

____________________
Programmer/Analyst
Captain D's, LLC

Post #4976
Posted 12/05/2006 2:38:48 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 9:49:13 AM
Posts: 4,796, Visits: 4,767
It sounds like you have some of the IncludeInForm settings changed.  What are the settings of your IncludeInForm properties on the form and on the business objects?

Post #4978
Posted 12/05/2006 2:48:11 PM


StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 07/22/2008 11:48:33 AM
Posts: 23, Visits: 129
D'oh. For some reason my IsDirtyOnExit changing back to true didn't take. I just wasted support points.

____________________
Programmer/Analyst
Captain D's, LLC

Post #4981