﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Two BO in one Form</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 11 Sep 2026 06:12:20 GMT</lastBuildDate><ttl>20</ttl><item><title>Two BO in one Form</title><link>http://forum.strataframe.net/FindPost14921.aspx</link><description>Ok, I have already created the basic maintenance forms from my first StrataFrame application, but now I have a different one and want to ask the best solution for creating it.&lt;/P&gt;&lt;P&gt;My new form, has a treelist (already populated with a BO). This treelist has 2 type of&amp;nbsp;nodes (categories and accounts).&lt;/P&gt;&lt;P&gt;When the user click on an account, I want to display a panel with the fields from the Account BO and when he clicks on a category, I hide the account panel and display the category panel with the categories BO fields.&lt;/P&gt;&lt;P&gt;I have also an MaintenanceFormToolStrip.&lt;/P&gt;&lt;P&gt;What's the best approach to manager this two panels with his BO?&lt;/P&gt;&lt;P&gt;I think that changing the primarybussinesobject from the from every time the users clicks on an treelist item and retrieving the selected item in the business object can be the solution, but I'm not sure?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Alex B.</description><pubDate>Mon, 17 Mar 2008 14:51:56 GMT</pubDate><dc:creator>Alex Bibiano González</dc:creator></item><item><title>RE: Two BO in one Form</title><link>http://forum.strataframe.net/FindPost14976.aspx</link><description>Yeah SetActivePage.&amp;nbsp; Also, on our main form that has around 13 BusinessObjects I have a Case statement that switches the Form's PrimaryBusinessObject depending on which node type the user has clicked on (around 25 node types) so that the MaintenanceFormToolStrip buttons work properly with whichever record in whichever BusinessObject they want to work on.&amp;nbsp; I put the code to choose which BO is the PrimaryBO in the MaintenanceFormToolStrip ClickEvent. Not sure if that is the best place for it, but it works for out app.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Robin Giltner</description><pubDate>Mon, 17 Mar 2008 14:51:56 GMT</pubDate><dc:creator>Robin J Giltner</dc:creator></item><item><title>RE: Two BO in one Form</title><link>http://forum.strataframe.net/FindPost14975.aspx</link><description>SetActivePage()...OK, I wasn't hallucinating :crazy:.  I've used that too!  :P</description><pubDate>Mon, 17 Mar 2008 14:23:10 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Two BO in one Form</title><link>http://forum.strataframe.net/FindPost14970.aspx</link><description>Or call the SetActivePage method :)&amp;nbsp; Yeah, I missed that on your previous post.&amp;nbsp; Good call.</description><pubDate>Mon, 17 Mar 2008 13:22:46 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Two BO in one Form</title><link>http://forum.strataframe.net/FindPost14960.aspx</link><description>[quote]I think the method is ActivatePage() on the PanelManager itself.  [/quote]&lt;br&gt;
&lt;br&gt;
I was wrong...did this last Friday after posting this and the above mentioned method is wrong (way wrong :blush:).  You actually use the .CurrentPage property. Just set it to the page that you want to show.</description><pubDate>Mon, 17 Mar 2008 11:30:54 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Two BO in one Form</title><link>http://forum.strataframe.net/FindPost14928.aspx</link><description>Yup, Greg nailed it :)</description><pubDate>Fri, 14 Mar 2008 22:04:18 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Two BO in one Form</title><link>http://forum.strataframe.net/FindPost14923.aspx</link><description>You would use the PanelManager (a SF control) to host the two panels.  You could then simply activate the desired panel based on the node clicked in the tree. I think the method is ActivatePage() on the PanelManager itself.  The PanelManager greatly simplifies the design experience so you don't have to muck around with moving panels all over the place to design them or to building the panel in code.  &lt;br&gt;
&lt;br&gt;
I had never thought to switch the PrimaryBO of the form to get the maintenanceformtoolstrip to work with two BOs...let us know how that works. It sounds promising. :D&lt;br&gt;
&lt;br&gt;
If it doesn't, you could pretty easily just roll you own toolstrip that would save to the correct BO based on the node selected.</description><pubDate>Fri, 14 Mar 2008 17:47:18 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>