Ben Hayat
|
|
Group: Forum Members
Posts: 374,
Visits: 1.2K
|
I have a form that creates the info for a "Store". As part of this form there is a MaintenanceToolStrip there.
Once the user creates the store and the store is selected, on the right side, I have designate an area that the user can cab create multiple employees for that store. For that, I placed a second MaintenanceTooStrip to connect to my EmployeeBO, so the user can add/edit/delete employees while they are in store form.
I can't find a property to connect the MaintenanceStripTool to a BO. This is a common thing that you can navigate between master/detail records within the same form.
Thanks!
..ßen
|
|
|
Greg McGuffey
|
|
Group: Forum Members
Posts: 2K,
Visits: 6.6K
|
The maintenanceformtoolstrip is designed to connect to the first BO in the collection of BOs associated with the form. You can have as many as you want on a form, but they will all talk to the same BO  (actually, god only knows what would happen if you had multiple on the same form). With a bit of work you could just roll your own. The browse dialog functionality is the only part I'm not familiar with. Just make a toolstrip with edit, add, save, undo and remove buttons as well as the move first, previous, next and move last. Add a BusinessObject public property of type BusinessLayer. I'd add the ResetBusinessObject and ShouldSerializeBusinessObject properties to, to support the designer. Wire up the buttons using the BO methods. Finally, react to the EditStateChanged and Navigated events to enable/disable the buttons as needed. Then you can have as many as you like on a form. However, before you do that, if the BOs are related (a parent and many children), I'd try just settings in the "StrataFrame: Form Include Settings". By setting the IncludeInFormAdd, IncludeInFormEdit, etc. properties to True, the maintenanceformtoolstrip will work with any BO with these properties to true. The first BO in the collection (the main BO), will have all of these set to true. Others by default with have only IncludeInFormSave set to true. If you setup the parent relationship for the BOs, then set the parent BO on the instances, set the appropriate properties to have child records filtered and have set the IncludeInForm[n] properties, then all editing/navigation will be in synch and parent/child relationship managed. I have done the first (manage each BO separately), but I'm going to be investigating the other method. It seems easier, the user experience is nicer (they don't care about parent/child stuff...they just want to edit/add stuff), but I don't know the limitations/gotchas yet. Good luck.
|
|
|
Ben Hayat
|
|
Group: Forum Members
Posts: 374,
Visits: 1.2K
|
Thanks Greg;
But I really need to deal with each BO independently, and I don't want to roll my own toolstrip, since I'm in the middle of writing an application and not creating and debugging controls. I think if SF team make this property public, then we can override the BO with the secondary one on the form.
I'm waiting for SF team to respond to this post. My other alternative to create another form, but that defeat the purpose of having everything for the user in one form.
Trent, can we easily solve this problem? I'm going to have many forms that are going to be dependent of Stores and then within customer file, I need multiple toolstrip to create multiple shipping address, credit cards, notes and etc.
Thanks!
..ßen
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
Actually, the maintenance form toolstrip is designed to talk to the Primary Business object of the form rather than the first in the collection. Many times the primary BO happens to be the first item on the collection though, but ultimately it is the primary BO. You have two options. One, you may consider creating a user control that has a maintenance form toolstrip on it and then transate the BOs through the BOTranslations property. Second option is to create your own toolstrip, which really would not be a difficult task since there is not that much functionality that needs to be added. You could also expose a property on your toolstrip that accepts a BO as a property and the toolstrip then manages that BO.
|
|
|
Ben Hayat
|
|
Group: Forum Members
Posts: 374,
Visits: 1.2K
|
Trent; Many times the primary BO happens to be the first item on the collection though, but ultimately it is the primary BO. Would that break your code if it just points to the first one when we drop it and then we can change it? One, you may consider creating a user control that has a maintenance form toolstrip on it and then transate the BOs through the BOTranslations property. I really don't want to go this route of creating a bunch of User Controls, for all these sub sections for all these forms. Second option is to create your own toolstrip, which really would not be a difficult task since there is not that much functionality that needs to be added. You could also expose a property on your toolstrip that accepts a BO as a property and the toolstrip then manages that BO. Wouldn't that be a better and cleaner approach if you would expose the BO property? It can still default to the primary BO, and then we overwrite that. This way, everyone gets this feature rather than each one of us do it our own way? By creating my own toolstrip, what about the BrowseDialog functionality? I need to offer that to the user for each BO search?
..ßen
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
Wouldn't that be a better and cleaner approach if you would expose the BO property? It can still default to the primary BO, and then we overwrite that. This way, everyone gets this feature rather than each one of us do it our own way? No. If you look at the code behind the maintenance for toolstrip, it never talks to the PrimaryBusiness object directly. It actually uses form Add, Edit, Save, Undo methods, etc. It also takes into account the IncludeInForm properties. So you can change the behavior of the toolstrip by setting the IncludeInForm properties on the form and on the individual BOs.
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
Hi Ben. I'm very sorry if I didn't get the picture properly here... but what you are trying to accomplish isn't something like the Customer Maintenance form in the CRM Sample? With the Credit Cards page? Or even the Order Entry form? By the way, haven't seen any nice biquinis by the beach since the classes... well, that might be because I haven't been to the beach... for years now!!!
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
Hehe  yeah, I could use a vacation to the beach! As for your question, yes, this is the approach that we took, and as I had mentioned in a previous post to Ben Hayat, we create a custom toolbar for each of those sections. It is literally only a line of code within those buttons that gets called and potentially shows a child form. We also create a SetToolbarItems() method in those type of forms that properly enable/disable those toolbars depending on the editing state, etc.
|
|
|
Ben Hayat
|
|
Group: Forum Members
Posts: 374,
Visits: 1.2K
|
what you are trying to accomplish isn't something like the Customer Maintenance form in the CRM Sample? With the Credit Cards page? Or even the Order Entry form? Yes, except I want to offer the same toolstrip that is used for the customerBO, for credit card or in case of orders/order lines. In toolstrip, you get New, Update, Delete, Undo, navigation, browse Dialog that look a certain way and depending on what you are doing, the buttons become enabled and disabled. But I have to give that up and add primitive style looking (like it is in the credit card section) which does not match the customer side. The client will NOT accept that!!! And they had already told me they want the Credit card, shipping addresses, notes and other multi lines in the same form as customer form in different tabs.
..ßen
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
I see... Not trying to be annoying, but I even prefer them to be diferent from the main toolstrip, which is there to create the parent in this form. So, in any tab your customer might be, he will know that if he chooses New from the main toolstrip, he will be able to go straight to the main Tab and insert the parent information, and then, in each tab of your form there will be a customized (like in the sample, did you notice the pictures for Add, etc., credit cards?) toolstrip with the choices you need. Probably in many cases you will only need an Add, Edit and Delete, or something. If you didn't like all this, just shout at me, I won't cry...
|
|
|