Noop, I don’t do FileMaker… Gave it a try once, couldn’t figure it out in five minutes how it worked… ![Mad :x]()
Spoke the guy who said adding related tabs at runtime wasn’t possible and he forwarded me to the guy who would really know and his question was: Why do you need to add related tabs at runtime? Because at runtime you would need to know all the data, like which relation to use and if you know that allready, you can add the related tab in designmode…
So, why do you need to have the ability to add related tabs at runtime? here are a couple of scenario’s:
1: A multiUser, Multi Company system, where users might have rights to access data for multiple companies. the configuration for which data is shown differs per Company, so when the a user looks at data for COmpany 1, tabs A,B and C are shown (all related tabs). Then the users looks at data for Company 2 and only tabs B and C can be shown (so you remove tab A). Then the User goes back to looking at data for Company 1, so tab A needs to be added again…
2: A ProductOffering module, where I have a table called Products, with a Column called Type. I want to show a TabPanel with per Type of product 1 tab. Since Admin users can define new Product Types, I need to be able to add more tabs depending on the number of product Types defined.
3: A FrameWork solution, where others can add extra functionality by building new forms in a specific module. By registering the new forms in a table, with the proper data and using addTab functionality build into the FrameWork solution that adds tabs to tabpanels based on the data in this specific table, the forms designed inside the module are displayed, without giving the designer of that form access to the main solution
Maybe somebody else has more scenario’s?
To me the argument that you can add the related tabs at designtime, because you need certain information doesn’t really fly. Dynamic GUI’s is the keyword here, offering different users a different GUI, based on specific configuration.
The argument that for related tabs you need to knwo certain information that you allready have available at designtime also goes for the current situation where you can add relationless tabs. The only extra thing that you need to know is the relation, I think. The argument could have been used for adding relationless tabs, but apparently, adding relationless tabs at runtime was deemed a nessecity ![Smile :)]()
If there would be a function to hide/show an existing tab, this would solve scenario 1, but wouldn’t help for scenario 2 or 3.
All in all, I think the ability to add related tabs at runtime would be a good addition to the current functionality.
Maybe this could be done by specifying the relation when adding the tab, or by making
forms['xxx'].controller.loadRecords(relation)
``` change the selection in the child form, when the selection changes in the parent form (currently, according to my experience, when you call this function, the foundset of the child form is set to the correct related foundset based on the selection in the parent form, but when the selection changes in the parent form, the foundset in the childform remains as is, untill you call this function again).
So, a long story. I hope it sheds some light on the reason for wanting to add related tabs dynamically. It goes a bit off topic (my issue with getting the foundset empty on the form in the relationless tab still stands).
Paul