Thursday, August 19, 2010

Hiding Tabs in FIM 2010 RCDCs

Usually I’m fairly critical about the limited flexibility with RCDCs but it does present some fun challenges if you do decide to employ them in your deployment. 

In the FIM Portal you can configure the RCDCs to add or remove tabs (called ‘Groupings’ in RCDC). Here is the snippet from the RCDC XML Reference explaining this functionality:

Visible: You can hide an RCDC page tab or its heading by setting this attribute to false. By default, this optional, Boolean-type attribute is set to true. This attribute is functional only on a Content Grouping.

Here is an RCDC XML snippet showing an example of a grouping:

<!--Sample for a Header Grouping—>
<my:Grouping my:Name="ContentGroupingSample" my:Caption="Sample Content Grouping" my:Description="Some description for content grouping" my:Visible="true">
<my:Control my:Name="DisplayName" my:TypeName="UocTextBox" my:Caption="Display name" my:Description="This is the display name of the set.">
<my:Property my:Name="Required" my:Value="True"/>
<my:Property my:Name="MaxLength" my:Value="128"/>
<my:Property my:Name="Text" my:Value="{Binding Source=object, Path=DisplayName, Mode=TwoWay}"/>
<!--End of Header Grouping Sample-->

Hiding this tab is as easy as setting Visible=”false”, but what if you want to do it dynamically?

One way to do this is to use a Boolean attribute on the object instead of specifying ‘true’ or ‘false’.  This can be an attribute you don’t even show to the user, just something you treat as a system attribute to control the rendering of the object in the RCDC.

Here’s an example:

my:Visible="{Binding Source=object, Path=ShowContentTabA, Mode=TwoWay}"

Now when the RCDC loads it will look at the ‘ShowContentTabA’ attribute to decide if the tab should be displayed or not.


Brad Turner said...

Nice, couldn't find this anywhere else! Also, the Mode=TwoWay is optional in this regard.

Peter said...

Hi Craig,
Let's say the user is filling in a separate request object and you want to hide/display a tab based on a boolean from the user. How would you do this?