Jacek Kałucki wrote: > Użytkownik Jacek Kałucki napisał: > >> Użytkownik Nate Lowrie napisał: >> >> >>> Here is a doozy. I included my current bizobj code below. When it >>> runs, validate record is fired and everything is good. However, I am >>> getting some weird behavior when: >>> >>> I uncomment the DefaultValues line >>> Existing records call validateRecord fine >>> I call the new method on the bizobj and try to save the new record >>> validateRecord never is called on save >>> >>> If I comment the line out again and run my app, the validateRecord >>> method fires for both new and existing records. >>> >>> >>> >> The validateRecord() method is called only for changed records. >> Any default value doesn't change record/memento status. >> But you are right, IMHO there should be added SaveNewUnchanged >> property check, isn't it? >>
Ah, I see your point, though I don't think it is the right behavior. validateRecord should always be fired on a new record, because the fact that it is new makes it changed, even if the user hasn't modified any of the default values. Further more, if the DefaultValues dictionary is empty, the validation fires on a new record that the user hasn't changed. > > You can override this behaviour by calling validateRecord() manually > in beforeSave() method. > I understand your work-around, but its a total hack that shouldn't have to be done. Regards, Nate _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
