Child Form Save and Undo Buttons disabled


Author
Message
Ed Summers
Ed Summers
StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)
Group: StrataFrame Users
Posts: 15, Visits: 434
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

Attachments
no edit.gif (122 views, 19.00 KB)
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
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.

Tim Dol
Tim Dol
Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
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?

Tim Dol
Tim Dol
Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
Sorry...this should have been a new post.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
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.

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