Enable/Disable individual tabs in a strip

I have a tab strip with 4 tabs. I am wondering if there is a way to dictate which tabs are enabled or disabled, based upon a Client Tag called “MemberType”. For instance, if the user is “type” 1, then tabs 1,2 and 3 should be enabled. However, if he is “type” 2, then tabs 1,2, and 4 should be enabled.

I came up with a workaround that uses rectangles colored like the background that cover the tabs. The UserType tag controls whether the rectangles are hidden (thus, the tabs are visible) or visible (the rectangle blocks view of the tab). Clicking on a hidden tab still fired the SwapTo navigation event, so I had to make the rectangles navigate to the current page to make it appear like nothing happened.

I am interested if something more elegant can be done.

Cas

Cas,

Here’s an example of one way you could do it.

You would need to bind the Window’s MemberType property to the appropriate tag and change the Window names in the action script.
DynamicTabDemo.fwin (9.25 KB)

MickeyBob,
Thank you for the input - I can see how your script accomplishes this.

As a next step up, is there a way to gray-out or even hide a tab as soon as the page loads, based on the MemberType value, so that the member is not even tempted to select the “illegal” tabs in the first place?

Best regards,
Cas

There is probably a way to do it by manipulating the tab dataset (i.e., tabData) in the internalFrameActivated event for the window.

Depending on the MemberType, you would either delete the data for any tab not available to a member if you start out with all tabs configured, or add rows if you start out with an empty tab dataset.

I would develop an example of this but I just don’t have the opportunity right now. I might be able to get you a specific example by late tomorrow night. Someone else might have the opportunity to get you something more detailed in the meantime.

MickeyBob,
Please don’t spend any time on this - I was just hoping that there was an easier way.
Adding & deleting from the dataset using a script might be more than I really want to do.

It is working fairly well with my masking approach, so I can live with it for now.

Thanks for your help. I modified your code from your first example to show or hide the masks, and it works great. Thanks again.

Cas

Altering the dataset would be the best way to get tabs to appear/ disappear based upon an access level. This shouldn’t be too hard - check out the scripting library “fpmi.dataset” under “Technical Reference” in the user manual.

Okay, here’s another way of disabling tabs based on MemberType.

In this example, the tabData is manipulated to disable and alter the appearance of tabs.

Look at the code in the internalFrameActivated event for the window.

Let me know if you have any questions.
DynamicTabDemo2.fwin (14.8 KB)