how to manage show and hide the tab through conditional class or condition.
Hi
I have to manage the access of the tab through the condition instead of the security role. And I am using the Data list for the tab.
Thanks
Seema
-
Hi Seema,
You can do this with some JavaScript on page load passing any request parameters. In the simple example below I have used an "onchange" JavaScript action (instead of a page load function, but the concept is the same). Please note this only hides the tab, the content still exists in the page source. If it needs to be removed completely so that users can't get to the information at all, then the most secure way to do this would be to do it server side using Security Right Id's. This method would work regardless of how you create your tab list, you just need to select the correct element to hide or display.
Anyway I hope this is helpful. Best regards
Example:<Report ID="TabsConditional" SavedBy="LOGIXML\gmcKenna" SavedAt="2021-10-18 16:16:25" EngineVersion="12.8.675-SP1">
<Body>
<Division ID="divTabs" HtmlDiv="True" Class="container">
<InputSelectList OptionValueColumn="showTab" OptionCaptionColumn="showTab" ID="showOne" Caption="Show Tab One?" DefaultValue="@Request.showOne~">
<DataLayer Type="Static" ID="StaticDataLayer1">
<StaticDataRow showTab="True" />
<StaticDataRow showTab="False" />
</DataLayer>
<EventHandler DhtmlEvent="onchange">
<Action Type="Javascript" ID="actShowTab" Javascript="var mySelected = this.value; var tabOne = document.getElementById('tabOne'); if( mySelected == 'True') { tabOne.style.display = 'inline-block' } else { tabOne.style.display = 'none' };" />
</EventHandler>
</InputSelectList>
<Division ID="divTabContainer" HtmlDiv="True">
<Tabs ID="myTabs">
<TabPanel Caption="Tab One" ID="tabOne">
<Division ID="divOneContent" HtmlDiv="True" Class="ThemeContainerBordered">
<Label HtmlTag="h2" Caption="Tab one content" />
<LineBreak LineCount="10" />
</Division>
</TabPanel>
<TabPanel Caption="Tab Two" ID="tabTwo">
<Division ID="divTwoContent" HtmlDiv="True" Class="ThemeContainerBordered">
<Label HtmlTag="h2" Caption="Tab two content" />
<LineBreak LineCount="10" />
</Division>
</TabPanel>
</Tabs>
</Division>
</Division>
</Body>
<ideTestParams showOne="" />
</Report>0 -
We ran into an issue recently were we needed to control the display of data not based on a login's Security ID but rather the data that was being pulled for that particular login.
We used @Local data to get a list of the data we needed, then created a @Request.rdShow~ variable to control the tabs.0
Please sign in to leave a comment.
Comments
2 comments