How to set BO undirty ?


Author
Message
Philipp Guntermann
Philipp Guntermann
StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)
Group: Forum Members
Posts: 141, Visits: 263
Hi,

i have an issue with my maintanance forms allways starting with the maintanance toolstrip showing the save and undo buttons enabled and the navigate buttons disabled.

i guess this is because automations on the form cause the bo to become dirty. ?

so within the bo, i tried this, to set it "undirty":

        protected override void OnIsDirtyChanged(bool DirtyShouldBe)
        {
            if (this.isDirty && this.EditingState ==  BusinessEditingState.Idle)
                this.Save();
            base.OnIsDirtyChanged(DirtyShouldBe);
        }

however, this throws a stackoverflow exception.

So, what is the appropriate way to handle this ?

thanks.


Reply
Philipp Guntermann
Philipp Guntermann
StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)
Group: Forum Members
Posts: 141, Visits: 263
the problem has something todo with binding to the datetime-picker control.

on the form there are two of thoose. if i unbind them by selecting Business-Object = none in the property editor, the form behaves correctly (bo doesnt get dirty). however off course then they are not bound Smile

i am setting default values to thoose from the bo's SetDefaultValues procedure. however this aint the cause of the problem, because if i comment theese lines out, the bo still gets dirty.

the datetime picker controls are set up with following property values:

BindableValue = 01.01.1800
BindingField = MyDateTimeField
BindingProperty = Value
BindingUpdateMode = OnPropertyChanged
BusinessObject = MyBO
ClearOnNULL = True
CustomFormat = dd.MM.yyyy HH:mm:ss
Format = Custom
MaxDate = 31.12.9998
MinDate = 01.01.1753
NullDateValue = 01.01.1800
ShowUpDown = True
StripTimeFromValue = False
Value = 01.01.1800

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