OnDirtyChanged wish?

OnDirtyChanged wish?

Old forum URL: forums.lhotka.net/forums/t/7614.aspx


rfcdejong posted on Saturday, September 12, 2009

Our controller around a business object needs to be signalled when the business object or one of his childs has changed for the first time, so going from Clean to Dirty state.

I though it wouldn't be a problem, listening to OnPropertyChanged and OnChildChanged, whenever one of those got hit for the first time then i would just throw an event.

But it goes deeper, having a list as child in the business object it only does a childchange when the list self changed. But when an item within the list goes from clean to dirty there isn't an OnChildChanged event.

I noticed that the IsDirty property is asking the FieldManager for his state.

Am i overlooking an event like OnDirtyChanged, or could this be a wish on the csla issue list?

rfcdejong replied on Monday, November 02, 2009

bump

RockfordLhotka replied on Monday, November 02, 2009

rfcdejong:
[...]having a list as child in the business object it only does a childchange when the list self changed. But when an item within the list goes from clean to dirty there isn't an OnChildChanged event.

That should not be true. If a child in the list changes that should cause a ChildChanged event to flow up through the object graph. I'm pretty sure this works correctly, as I have apps that rely on this behavior.

I do know there were a couple bugs around the ChildChanged event several versions back, but if you are running 3.7.x it should be working correctly.

rfcdejong replied on Monday, November 02, 2009

Strange, i'll dig into this since it has been a couple of weeks ago we had issues with it. Often people at my company tent to find workarounds instead of solving it correctly or on a more generic way.

I'll let u know and if i find some time i create a test program.

Copyright (c) Marimer LLC