Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bindback and checkrules without attempting to save
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01239479
Message ID:
01241389
Views:
24
Govinda,

>So if I wanted to have the child objects bind back and save their records, I should register a statechange handler that executes a Page.Save(childobj, ds, tab) for each child object?
>
>>Govinda,
>>
>>>I have a webform where I would like to validate the fields, if validation passed, attempt to run a separate process, and if that process completes successfully, then save the form data a new record. To my understanding, the only way to get that nice bindback functionality is by is by calling the Page.Save() method. Is there another way?
>>>
>>>I know I can call Obj.Rules.CheckRules(), but it's the binding back that I'm having a problem with. Should I just give up trying to use the Page.BindBack() and go back to manually copying the field values to the dataset?
>>
>>If you need to run a separate process after business rules have been successfully validated, you can register the process with the business object's StateChange event and check for mmBusinessState.Saving in the event handler method. If the state passed in the mmBusinessStateEventArgs parameter is set to mmBusinessState.Saving, then you know the business rules have passed successfully.

If I understand your scenario correctly you are simply trying to run an additional process after business rules are validated. I don't know what kind of process you want to run, but I'm simply suggesting you register the object that runs the additional process as a listener for the business object's (the one that's being saved) StateChange event. Regarding data binding, you don't need to call each child object individually when saving, because if they are registered as children of a parent business object they will automaticlaly save if their AutoSaveOnParentSaved property is set to true. Just calling the parent's Save is sufficient.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform