Edhy Rijo
|
|
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
|
Hi, I have 3 related tables which I would like to be able to show in a single SF Maintenance Form, I also would like to use a tree control to show all the data (pretty much like MS Outlook). Is there a SF class that would help me out get this form started? also how would I handle the data manipulation (adding, edit, delete) of the children records for the other two tables, since the main one will be handle by the ToolStrip control. Thanks!
Edhy Rijo
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
This is something that we do all of the time. One control that can come in handy here is the new ThemedLinkMenu, which I have attached the sample that will be included in the next update. This sample will not show you exactly what you are wanting, but I thnk it will get the wheels turning. This is an approach that we take often. We will use the ThemedLinkMenu in conjunciton with the PanelManager to product this type of interface. Second, you may choose not to use the MaintenanceFormToolstrip in this example. You can handle the IsDirtyChanged event on the BO to automatically enable/disable the Save/Undo buttons. Next, you can use a link on the ThemedLinkMenu or a right-click context menu for Add/Delete/etc. There are a lot of ways to skin this cat. You can also use the TreeView like you are talking about. You can see how we create a unique class that we stuff in the tag property of the tree node in the Explorer Form sample that comes with the framework. This is a relatively length discussion and something we talk about in length in the training class. But I can give more details as you progress. Hope this gives you some ideas.
|
|
|
Edhy Rijo
|
|
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
|
Hi Trent, Thanks for this info, it is what I was looking for. I will check the sample and then start playing around with it.
Edhy Rijo
|
|
|
Edhy Rijo
|
|
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
|
Hi Trent, In the same context, I have a standard Maintenance Form with 1 BO and some textboxes controls, I would like to add a child BO and been able to Add/Edit/Delete on the child BO in the same form. Is this possible with SF? Also is there any sample of what code will be in the child BO buttons (Add/Edit/Delete) or can I use another MaintenanceFormToolStrip to manage the child BO?
Edhy Rijo
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
Is this possible with SF? Sure. There are many different approaches. If you want a child record to be added every time that you add a parent record, or when you click the Add button on the MaintenanceFormToolstrip, then you can just use the IncludeInForm properties on the Form and the BOs. By default, a Save and Undo will update every dirty BO on the form, however, an Add only adds a new record to the PrimaryBusinessObject. If you want the Add to create a record on another BO as well, then you can use the IncludeInForm properties. First, select the form and navigate to the IncludeInFormAddType and set it to DeterminedByBusinessOjbect. Then, select the BOs on the form that you want to have a new record added when the Add button is clicked. Navigate to teh IncludeInFOrmAdd property and set it to True. Any BO with this property set will then have a new record created when the Add button is selected. You can take a different approach when you have a one-to-many relationship. In this scenario, you will either want to add another MaintenanceFormToolstrip or just create your own toolstrip and call the Add method on the BO when you want to add a child record.
|
|
|
Edhy Rijo
|
|
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
|
Hi Trent, Thanks for the explanations. I attached an image of the form I am currently working so you can have a better idea of what I want to accomplish. In this form I have 2 business objects CustomerBO1 and CustomerBuildingAddressBO1 (this is the child), I tried adding a 2nd MaintenanceFormToolStrip to handle the CustomerBuildingAddressBO1 but I did not find a way to attached either the BO to the TS or viceversa. So I ended up with a Windows TS and manually add the buttons, and call the CustomerBuildingAddressBO1.Add(), etc which works fine, but I think there should be an easier way to tide a MaintenanceTS to the child BS to do this instead of manually having to control all the TS buttons state, and if this is the only way, could you please tell me how to manage buttons state (enable/disable) for the child BO? Thanks!
Edhy Rijo
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
The MaintenanceFormToolStrip is designed to operate on the business objects on the form that are specified by the IncludeInFormX properties. So, you can only have one MFTS per form (technically, you can have more than one, but they would all do the same thing). So, if you have a toolstrip that you would like to use on a child business object, you will need to manage the states manually. To do so, attach to the child business object's EditingStateChanged event. This event will tell you the editing state of the business object and you can enable/disable the buttons accordingly from within the event handler.
|
|
|
Edhy Rijo
|
|
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
|
Ben Chase (10/02/2007)
The MaintenanceFormToolStrip is designed to operate on the business objects on the form that are specified by the IncludeInFormX properties. So, you can only have one MFTS per form (technically, you can have more than one, but they would all do the same thing). So, if you have a toolstrip that you would like to use on a child business object, you will need to manage the states manually. To do so, attach to the child business object's EditingStateChanged event. This event will tell you the editing state of the business object and you can enable/disable the buttons accordingly from within the event handler. Hi Ben, Thanks for the heads up on this one. It looks like this would be a nice Enhancement Request, to have a SF ToolStrip class which can be attached to any Business Object. Since SF already have the MaintenanceFormToolStrip, I am sure it could no take you guys a lot of time to implement this feature.
Edhy Rijo
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
This is why we added the IncludeInForm properties. Attaching a BO to a specific MFTS is a total rewrite of the MFTS. The MFTS is basically a "dumb" control and listens to the events on the form and calls methods on the SF BaseForm. Since there was a desire for the specific BO functionality, then this is why we provided the IncludeInForm properties. As for a child BO, we will generally create a ThemedToolStrip with a custom Add/Edit/Delete button on it and manually manage the enabled states of the buttons and maually call the Add on the child BOs.
|
|
|
Edhy Rijo
|
|
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
|
Trent L. Taylor (10/02/2007) As for a child BO, we will generally create a ThemedToolStrip with a custom Add/Edit/Delete button on it and manually manage the enabled states of the buttons and manually call the Add on the child BOs.Hi Trent, For this very reason is that I would like to see a class to handle this kind of situation, so this way if I have several form, with several child BOs, I could simply drop as many instances of this ToolStrip class and set it to the BO I would like to have the Add/Edit/Save/Undo buttons, instead of me adding this repetitive code everytime in every project. Productivity for developers  In Visual FoxPro, I would simply create a subclass of the MFTS and add it to my needs, but right now, I don't have all that experience in .NET and since I am learning with SF, then I would simply try to get as many new productivity features I may miss, included in the framework via the Enhancement Request forum. P.S. With Ben suggestion I was able to have the toolstrip working the way I want it for the BO, even though I am learning by doing it manually, for other forms/projects I rather have a class to drop and set some properties to make it work.
Edhy Rijo
|
|
|