| | | 
StrataFrame Beginner
       
Group: StrataFrame Users Last Login: 09/17/2008 8:43:45 AM Posts: 13, Visits: 409 |
| When I call this form as a child, I hit the EDIT button to get into edit mode. After I change the value of a textbox and tab to the next control, I am expecting the SAVE and UNDO buttons to become enabled. That does not happen. However, when I close the form, it does prompt me to save changes, so it recognizes the changed data. Please let me know why the SAVE and UNDO buttons are not available in this scenario.
(Screenshot attached)
Thanks for your help,
Ed Summers
Remember, You Can Pick Your Friends
You Can Pick Your Nose But
You Can't Pick Your Friend's Nose
|
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 10:13:07 AM Posts: 4,799, Visits: 4,768 |
| | ARe you calling this form through the ChildFormDialog control? In any case, the MaintenanceFormToolstrip takes its queue from the form. The first thing to look at is the PrimaryBusinessObject of the form. If this business object is not placed in Edit mode then this toolstrip will not behave accordingly (using the default settings). The MaintenanceFormToolstrip can react several ways. All StrataFrame forms have IncludeInForm... properties. By default all Include settings look at the PrimaryBusinessObject except the save, which looks at all business objects. There are three options: PrimaryBusinessobject - References only the primary business object when taking a certain action
AllBusinessObjects - All business objects on the form will be included when taking an action
DeterminedByBusinessobject - Looks at the Include properties on the business object to determine if it will be included in a certain action. To learn more about these actions look in the help documentation under:
Business Layer -> Configuring a Business Object -> Form Include Settings Next, the toolstrip will not change unless the EditingStateChanged event is fired. This is raised when the Edit() method on the form or business object is called. For example: MyBo.Edit(). As for the form notifying you of the changes, this is not related to the MaintenanceFormToolStrip. It has to do with the AutoShowSaveChanges property on the form. When the form is closing and the AutoShowSaveChanges property is set to True, the form will look at the business objects to see if any of them are dirty (MyBO.IsDirty). If so, it will raise the message. So just to remove any confusion, the dirty state of the BO is not related to the MaintenanceFormToolstrip. |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: 11/27/2008 10:53:17 AM Posts: 314, Visits: 1,276 |
| | I have a requirement to disable the delete button on the MaintenanceFormBarManager control based on a record status to prevent the record from begin deleted. I have added code in the BO navigated method to disable the button, which seems to work fine, however when I click on Edit and then click on UnDo, the delete button becomes enabled again. I tried disabling the button in the AfterUndo and the EditingStateChanged events but this doesn't seem to work. Is there a different approach I should be taking? |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: 11/27/2008 10:53:17 AM Posts: 314, Visits: 1,276 |
| | Sorry...this should have been a new post. |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 10:13:07 AM Posts: 4,799, Visits: 4,768 |
| Is there a different approach I should be taking? You are never going to be able to totally control the enabled state of the MaintenanceFormToolstrip this way. It is an encapsulated control and follows the logic as mentioned in the previous post. You have two options. Option 1 Hide the Delete button the MaintenanceFormToolstrip by setting the IncludeDeleteButton property to False. You can then add another button to the end of the toolstrip (or create another toolstrip) that has the delete logic you require. Option 2 Your second option is to just create your own maintenance form toolstrip. It is not a difficult task since none of the logic is written in the MaintenanceFormToolstrip anyway. You will just need to handle the EditStateChanged, Navigated, etc. events and then use the Add(), Edit(), Save(), Undo(), etc methods on the form. |
| |
|
|