473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Dynamic Tabstrip not working

I'm using the IE webcontrols (obviously) trying to dynamically generate a
tabstrip based of a DTS package. I can get the tabstrip to show if I assign
the generation after the page completely loads and I trigger the execution to
a button/click/etc... However if I try to link the execution to onLoad I get
"dynaPage is undefined." DynaPage being the multipage I create dynamically.
Not sure why, and what I need to change to fix this. Any ideas?? Thanks in
advance!

<HTML>
<HEAD>
<TITLE>TabStrip Test</TITLE>
<script>
var lastPage = false;
function setupReport(oButton)
{
addPage("Test1","1");
addPage("Test2","2");
addPage("Test3","3");
lastPage = true;
addPage("Test4","4");
showPage(dynaPage);
hideButton(oButton);
}
function addPage(name, content)
{
var pageIndex = dynaPage.numPages;
var oNewPage = dynaPage.createPageAt(pageIndex);

oNewPage.setAttribute("id", name);
oNewPage.setAttribute("innerHTML", content);
addTab(name);
}

function addTab(pageID)
{
var tabElements = dynaTab.numItems;
var oNewTab = dynaTab.createTabAt(dynaTab.numItems);
oNewTab.setAttribute("text", pageID);
addTabSeparator();
}

function addTabSeparator()
{
var tabElements = dynaTab.numItems;
var oNewSep = dynaTab.createSeparatorAt(tabElements);
if (lastPage){oNewSep.setAttribute("defaultStyle","wi dth:100%;");}
}

function importBehaviors() {
tsNS = document.namespaces.add("ts","tabstrip.htc");
mpNS = document.namespaces.add("mp","multipage.htc");
tsNS.doImport("tabstrip.htc");
mpNS.doImport("multipage.htc");
var oTabStrip = document.createElement("ts:TABSTRIP");
var oMP = document.createElement("mp:MULTIPAGE");
oTabStrip.id = "dynaTab";
setTabStyle(oTabStrip);
oMP.id = "dynaPage";
setPageStyle(oMP);
oTabStrip.targetID = "dynaPage";
oReport.appendChild(oTabStrip);
oReport.appendChild(oMP);
}
function setTabStyle(tab)
{
var dStyle = "color:#AAAAAA; background-color:#EEEEEE;
border-color:#AAAAAA; ";
dStyle += "border-width:1px; border-style:solid; font-weight:bold; ";
dStyle += "font-family:Verdana; font-size:11px; height:37px; width:100px;
";
dStyle += "text-align:center;";
tab.setAttribute("tabDefaultStyle", dStyle);
tab.setAttribute("tabHoverStyle", "color:blue");
var sStyle = "color:#000000; background-color:#FFFFFF; border-bottom:none";
tab.setAttribute("tabSelectedStyle", sStyle);

var defStyle = "background-color:#FFFFFF; border-color:#AAAAAA; ";
defStyle += "border-width:1px; border-style:solid; border-top:none; ";
defStyle += "border-left:none; border-right:none;";
tab.setAttribute("sepDefaultStyle",defStyle);
}
function setPageStyle(page)
{
page.style.borderStyle="solid";
page.style.borderColor="#AAAAAA";
page.style.borderWidth="1px";
page.style.borderTop="none";
page.style.padding="10px";
page.style.visibility="hidden";
page.style.height="210px";
page.style.width="100%";
}

function hideButton(button)
{
button.style.visibility = "hidden";
}

function showPage(page)
{
page.style.visibility = "visible";
}
</script>
</HEAD>
<BODY onload="setupReport(document.all.generateButton);" >
<P ID="oReport">
<BUTTON ID="generateButton" onclick="setupReport(this);">Generate
Report</BUTTON>
</P>
</BODY>
</HTML>
--
~Greg
Nov 18 '05 #1
0 1591

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Eric | last post by:
I'm currently using the TabStrip control, but am having slighly difficulties. I've managed to retrieve the Items from the TabStrip using the Items property. But how can I enforce the changes that...
0
by: mehul | last post by:
CheckBox template always evaluate to False even if checked in a DataGrid hosted inside a TabStrip in ASP.NET Hi, I am trying to develop an ASP.NET application. I am using TabStrip (which is...
4
by: Pete | last post by:
Hello- I am have a real trying time finding information on this subject. I would like to create a web page that utilizes framesets (top & bottom) and a navigation control I created from a datalist...
2
by: Bart Schelkens | last post by:
Hi, I've created a webusercontrol that contains a tabstrip (Microsoft.Web.UI.WebControls.TabStrip. I want to raise the event when the selected index of the tabstrip changes. I wrote the...
9
by: Phin | last post by:
Hi, I have spent some time trying to get the tabstrip and multipage to work (from the IE web controls). I read the article from:...
9
by: Mardy | last post by:
Hello I've been using the tabstrip and multipage controls and really like the way this combination allows users to switch between tabs without a postback. I'd like to get more detailed...
0
by: Abbas | last post by:
How can I dynamically add a tab in TabStrip? I want to add/delete/update tab items in TabStrip control from csharp file .cs. Is it possible? or TabStrip will show "only" those items which I...
1
by: xpnctoc | last post by:
Here's the 30,000-ft. view: I wrapped an asp:Menu control in an ascx control. When I try to dynamically populate the menu in the ascx control, the items appear, but clicking on them fails to trigger...
3
by: Andreas Wöckl | last post by:
Hi Group! I have a web form that is created dynamically - so I create Textboxes, RadioButtonLists, CheckBoxLists and so on - I have found some articles that there may be some problems with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.