EditingState not changing after save


Author
Message
Larry Caylor
Larry Caylor
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K

I have a similar issue and I’m not sure if this is a bug oris by design. When Save is called on an object one of the first things thebusiness layer checks is IsDirty and if the object is  not dirty bails out of the save method returning SaveUndoResult = Success. The problem I’ve run into is that if I setthe SetDirtyOnEdit property on an object to False and subseqently call saveeither directly or indirectly (i.e. there is a parent child relationship) andthe object is not dirty I get a SaveUndoResult = Success but the object remains in EditingState = Editing. Noramlly I would expect a successful save to reset the editingstate to idle. This issue only became apparent when I switched  to having dialogs always open in edit mode and handling the cancel and save button enabled state based on the IsDirtyChanged event.

I’m currently working around the issue by using ny owninherited business layer that overrides the save methods. If the object is notdirty I call AcceptChanges on the data table in case it contiains changes from aprior save (if the object was a parent or had registered foreign keys) and thencall Undo on all rows to set the editingState to idle.


Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Is there something I'm possibly not doing correctly here that could be keeping the state from changing?? 

I guess it would depend on how the BOs are being used.  If the BOs are being translated from the parent to the child through the BOTranslations property then there are probably some other things that could play into this.  But the first thing I would do would be to create a simple test form (not user control) and just drop on a BO and your same Add/Edit/Save logic to see if you can reproduce.  If so, then can you send a simple sample so that I can take a look at your logic?  It might be faster than going back and forth over the forum a number of times Smile

Andria Jensen
Andria Jensen
StrataFrame User (416 reputation)StrataFrame User (416 reputation)StrataFrame User (416 reputation)StrataFrame User (416 reputation)StrataFrame User (416 reputation)StrataFrame User (416 reputation)StrataFrame User (416 reputation)StrataFrame User (416 reputation)StrataFrame User (416 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I'm probably doing something wrong here, but I have a BO which is managed by a user control I've created to handle the add/edit/save/undo events for BOs...I have to capture the EditingState of the BO after a save is done so that I can toggle the buttons.  It's supposed to work much like the maintenance form toolstrip you guys created.  I can add a new one, save it, and that works fine.  But when I edit and then save, the EditingState is staying at Editing and it should be going to Idle.  I have stepped through the code and after the save occurs there are no broken rules and the save returns Success, so I would think the EditingState should also have changed to Idle.  Is there something I'm possibly not doing correctly here that could be keeping the state from changing?? 
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search