Home > Domino Tips > Developer > Domino > Dynamic TAB tables for the Web
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DOMINO

Dynamic TAB tables for the Web


Jeremy Collett
04.07.2003
Rating: -3.18- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


This tip describes Web tab tables how they should work. There is no need to go back to the server to get the next tab.



Code

Add this pass through HTML to your Domino form. This creates the tab tables tabs. Replacing the <Computed Value>'s with a computed text that contains this @function

@ReplaceSubstring(@Subset
(@DbName ; -1) ; "/" ; "")

<table border="0" cellspacing="0" 
cellpadding="0">
<tr>
<td>
<table bgcolor="E1E1E1" border="0" 
cellspacing="0" cellpadding="0" 
id="Cat1TabOff" class="Tabs" 
style="display:none">
<tr>
<td valign="top"><img src="/
<Computed Value>/opentab.gif">
</td>
<td><a href=javascript:doCategories
('Cat1','Category') id="Cat1" class="Category">
<font size="1" face="MS Sans Serif">Tab 1
<font></a></td>
<td valign="top"><img src="/
<Computed Value>/closetab.gif">
</td>
</tr>
</table>
<table bgcolor="E1E1E1" border="0" 
cellspacing="0" cellpadding="0"  
id="Cat1TabOn" class="Tabs" style="display:">
<tr>
<td bgcolor="white" valign="top">
<img src="/<Computed Value>
/opentab.gif"></td>
<td bgcolor="white"><font size="1" 
color="black" face="MS Sans Serif">Tab 1
<font></td>
<td bgcolor="white" valign="top">
<img src="/<Computed Value>
/closetab.gif"></td>
</tr>
</table>
</td>
<td>
<table bgcolor="E1E1E1" border="0" 
cellspacing="0" cellpadding="0" 
id="Cat2TabOff" class="Tabs" 
style="display:">
<tr>
<td valign="top"><img src="/
<Computed Value>/opentab.gif">
</td>
<td><a href=javascript:doCategories
('Cat2','Category') id="Cat2" class="Category">
<font size="1" face="MS Sans Serif">Tab 2
<font></a></td>
<td valign="top"><img src="/
<Computed Value>/closetab.gif">
</td>
</tr>
</table>
<table bgcolor="E1E1E1" border="0" 
cellspacing="0" cellpadding="0"  id="Cat2TabOn" 
class="Tabs" style="display:none">
<tr>
<td bgcolor="white" valign="top">
<img src="/<Computed Value>
/opentab.gif"></td>
<td bgcolor="white"><font size="1" 
color="black" face="MS Sans Serif">Tab 2
<font></td>
<td bgColor="white" valign="top">
<img src="/<Computed Value>
/closetab.gif"></td>
</tr>
</table>
</td>
</tr>
</table>


<div id="Cat1Top" style="display:">

Put the information you want Tab 1 to display here

</div><div id="Cat2Top" style="display:">

Put the information you want Tab 2 to display here

</div>

Add this function to the JSHeader

 function doCategories(tmpid,tmpclass) {
//Check that the element being
 used have the class of category.
//
  if (tmpclass == "Category") {
//get the id for the section that 
want to be displayed.
   var topTargetID = tmpid + "Top";
   var topTargetElement = document.all(topTargetID);
//get the id for the ontab that 
want to be displayed.
   var onTabTargetID = tmpid + "TabOn";
   var onTabTargetElement = document.
all(onTabTargetID);
//get the id for the offtab that want to be hidden.
   var offTabTargetID = tmpid + "TabOff";
   var offTabTargetElement = 
document.all(offTabTargetID);
//hide all of the tables sections to start with.
   Cat1Top.style.display = "none" ;
   Cat2Top.style.display = "none" ;
//hide all of the tab with out links. 
   Cat1TabOn.style.display = "none" ;
   Cat2TabOn.style.display = "none" ;
//show all of the tab with links.
   Cat1TabOff.style.display = "" ;
   Cat2TabOff.style.display = "" ;
//display the relevent table section.
  if (topTargetElement.style.display == "none") {
   topTargetElement.style.display = "";
  } else {
   topTargetElement.style.display = "none";
 }
//display the relevent ontab section.
  if (onTabTargetElement.style.display == "none") {
   onTabTargetElement.style.display = "";
  } else {
   onTabTargetElement.style.display = "none";
 }
//display the relevent offtab section.
  if (offTabTargetElement.style.display == "none") {
   offTabTargetElement.style.display = "";
  } else {
   offTabTargetElement.style.display = "none";
 }
 }
 }

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Domino
Mimic Lotus Notes Domino application functionality on the Web
A single form to view and edit any Lotus Notes document
DECS and DCR external data access considerations
How to create non-scrolling Lotus Domino view headers on the Web
Disabling the 'Submit' button on a form
An easier way to update a rich text field
Results from Default Notes Search have # of responses in brackets
Lotus Notes/Domino veteran offers comprehensive list of app dev tools
Notes to XML. . .and back again
Creating thumbnail images using LS2J in LotusScript

JavaScript for Lotus Notes Domino
Trap JavaScript runtime errors in Domino Web apps
JavaScript workaround fixes Lotus Notes 8.x PostOpen event issue
Write HTML and JavaScript in Notes view rows and columns on the Web
JavaScript detects Web browser type and version in Notes/Domino 8.0.2
JavaScript creates a jump box on a Lotus Notes Web form
Top 10 Lotus Notes/Domino coding and development tips of 2008
How to create dynamic JavaScript in Notes Domino without formulas
Trap an attachment path via the Domino file upload control field
Converting Lotus Notes views to XML documents using JavaScript
Mimic Lotus Notes Domino application functionality on the Web

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts