StrataFrame Forum

permentantly setting BO State to "Edit"

http://forum.strataframe.net/Topic19017.aspx

By Leonard P. - 9/3/2008

Hello,



It's probably something very simple as setting a property on a BO, or maybe I am over thinking it. But I can't find an easy way to do it.

I want some BOs to default to "Edit" mode without user having to click "Edit" button on the maintenance form or setting it programmatically. Right now I am setting it in the code as soon as users navigates to a data row. But I want to be an automatic thing for certain objects. Can I do that?



Thank you for your help!
By Dustin Taylor - 9/3/2008

We accomplish this very thing in our medical app, but we handle it in the UI. Bottom line is that we turn the ManageUIReadOnlyState to false on the business objects we want to handle this way (which is most all of them in our case), and then handle the IsDirtyChanged event of our BOs to manage the Save and Undo buttons (we do this on the base form).

If you are using the 1.6.6 beta, I'd recommend taking a look at our StrataFlix sample as it shows exactly how we do all of this. In our case we don't use the maintenanceFormToolstrip but instead use a list of "actions" which appear or dissapear depending on whether they are applicable (i.e. the Save and Undo actions pop in and out depending on the dirty state of the BOs.)

By Greg McGuffey - 9/3/2008

One thing that was not immediately obvious to me is that the BO itself doesn't really go from readonly to editable. It is always editable. Thus, as Dustin indicated, you really just tell the BO to not manage the UI state. Pretty simple really! BigGrin
By Leonard P. - 9/4/2008

Thank you both, I knew it was something very simple. Smile