The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Auto hide/reveal tabs based on data
Posted: 29 Sep 06 8:36 AM
|
fiogf49gjkf0d Ok here is one of my first project ideas for my new company. We sell a number of products, each with their own details. My thought is to hide or unhide detail tabs for each of these various products depending on if they exist in the accounts product table.
Example: Company 1 has products A, B, & C Company 2 has products B & C.
Company 1 should have three tabs, one for A, B, & C. Company 2 should only have two tabs, one for B & C.
That's idea 1.
My second idea, similar to the first, uses one Account tab and under it uses the tab control to hide specific tabs (if possible) under there. So the user isn't bombarded with potentially many tabs for each account.
I think idea 2 is more elegant, but i'd like some feedback before I try to move forward on this idea.
FYI, as far as I know there would only be one version of each product under each account, so there would be no reason for two product A tabs or something of that nature, though that would be a nice addition to this plan. |
|
|
|
Re: Auto hide/reveal tabs based on data
Posted: 29 Sep 06 10:54 AM
|
fiogf49gjkf0d I suggest approach 2. There are bugs/unpredictable behavior with the MainView tabs.
This will hide the first tab in the collection of a tab control.
tabcontrol1.Tabs(0).TabVisible = false
Timmus |
|
|
|
Re: Auto hide/reveal tabs based on data
Posted: 29 Sep 06 3:41 PM
|
fiogf49gjkf0d I suggest approach 3: Use panels instead of tabs. Hide/Show a series of panels to make it look as if it's one big screen when in fact it's little subsets of information that when combined equal the whole. I do this on a number of my projects but they are in custom forms which have more real estate. Panels may not work for tabs that are associated with a MainView detail for example. |
|
|
|
Re: Auto hide/reveal tabs based on data
Posted: 02 Oct 06 7:20 AM
|
fiogf49gjkf0d Jeremy,
They are already doing this on some screens and considered it for this project. The problem we found would be that while there is only about 8 products now (could be managable with showing/hiding panels) the product line is very likely to increase greatly. This makes tabs a more managable option. A new product comes online, a new tab is added. A few controls and logic and it's done.
Both options are equally viable, I just feel like tabs would be a better fit in this case. May just be personal preference too. |
|
|
|
Re: Auto hide/reveal tabs based on data
Posted: 02 Oct 06 3:22 PM
|
fiogf49gjkf0d Marc, I like to use panels aslo, what about creating the panels or the tabs for that matter on the fly based on the product listings, this way you only have to enter the product in the product tables and be done.
Rich |
|
|
|
Re: Auto hide/reveal tabs based on data
Posted: 04 Oct 06 9:19 AM
|
fiogf49gjkf0d Rich,
I was actually considering that but I'm not certain how to dynamically populate a field like that. Or would the forms exist but only be added to the account when the account product was listed?
Marc |
|
|
|
Re: Auto hide/reveal tabs based on data
Posted: 04 Oct 06 10:46 AM
|
fiogf49gjkf0d Marc,
I have not tried this yet in SLX however in vb you can use the controls.add to add a new dynamically created control. I thought a while back Ryan posted an artical on this however I can not find it now.
Anyone else with help on Creating the control dynamically inside SLX.. in VB you can:
MyForm.Controls.Add("Label", "myLabel") 'create the control
|
|
|
|
Re: Auto hide/reveal tabs based on data
Posted: 04 Oct 06 12:46 PM
|
fiogf49gjkf0d Originally posted by RJ Eaton
Marc, Anyone else with help on Creating the control dynamically inside SLX.. in VB you can:
MyForm.Controls.Add("Label", "myLabel") 'create the control
|
|
Doesn't work. All controls on a form have to be created at design time. You could create control "templates" that function as multiple fields on a form but it's a bit of work to set that all up.
The only other thing I know of that comes close is a dynamic datagrid with inline editing. |
|
|
| |
|
Re: Auto hide/reveal tabs based on data
Posted: 04 Oct 06 1:54 PM
|
fiogf49gjkf0d Believe me, this has been suggested many times. The problem is that we're dealing with VBScript here .
My suggestion is to use .NET Extensions (if you're on v7) and if not, you can still use .NET (you don't need v7 to build customs in .NET for SLX) whenever you need to dynamically create controls for a requirement. |
|
|
|