iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello,
I am adding tabs at client side from preset values (i.e., not using tabindex) in hyperlinks. Basically the user clicks on a hyperlink, and a tab is created with a specific page loading in that new tab.
The problem is that clicking again on a hyperlink that has its tab still present in the collection raises this error: " WebTab Exception: Specirfied name "xyz" alread exists in TabPages collection".
I need to block this error and, instead, provide one or both of the following two solutions:
I have attached a simplified working project (just open DynamicTab.aspx and use the hyperlinks on the left pane to create the tabs).
I would greatly appreciate if you could modify the script provided in DynamicTab.aspx so as to raise an alert and/or make the existing tab active, instead of throwing an Exception.
Regards.
Jean
I have attached a simplified working project
The JavaScript exception persists because the WebTab object finds that TabPage with specified name “xyz” already exist. In order to block this error, you can try to add a validation that will check whether TabPage with specified name “xyz” already exist or not before invoking the AddNewTabItem() method.
The script below is shows the modified version of your AddNewTab JavaScript function.
function AddNewTab(name) { var tab = ISGetObject("WebTab2"); if (!tab.TabPages.GetNamedItem(name)) { var newItem = tab.AddNewTabItem(name, name, null); var activeTab = newItem; activeTab.ContentMode = "UseIFrame"; newItem.SetActive(); // set the newly created tab item as active // insert reference in newly created tab setTimeout(function () { activeTab.SetContentURL(name + ".aspx"); }, 50); } else { // 1.Raise a simple alert that simply tells the user: // "This tab is already open"; and/or alert("This tab is already open"); // 2.Simply return the focus on the existing tab, if found in the colletion, // instead of trying to create it. tab.TabPages.GetNamedItem(name).SetActive(); } }
Hope this helps.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname