﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebDesktop - WebTab - Error with dynamically created tabs   </title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebTab---Error-with-dynamically-created-tabs/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>WebTab - Error with dynamically created tabs   </title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebTab---Error-with-dynamically-created-tabs/</link><pubDate>Tue, 15 Nov 2011 00:17:54 GMT</pubDate><dc:creator>JNguimb</dc:creator><category>WebTab</category><description>Beautiful.&amp;nbsp; Thank you.&lt;br /&gt;</description></item><item><title>WebTab - Error with dynamically created tabs   </title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebTab---Error-with-dynamically-created-tabs/</link><pubDate>Mon, 14 Nov 2011 22:27:21 GMT</pubDate><dc:creator>yudi</dc:creator><category>WebTab</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;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.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;The script below is shows the modified version of your AddNewTab JavaScript function.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;&lt;span style="color: blue"&gt;function&lt;/span&gt; AddNewTab(name) {
    &lt;span style="color: blue"&gt;var&lt;/span&gt; tab = ISGetObject(&lt;span style="color: #a31515"&gt;"WebTab2"&lt;/span&gt;);

    &lt;span style="color: blue"&gt;if&lt;/span&gt; (!tab.TabPages.GetNamedItem(name)) {
        &lt;span style="color: blue"&gt;var&lt;/span&gt; newItem = tab.AddNewTabItem(name, name, &lt;span style="color: blue"&gt;null&lt;/span&gt;);
        &lt;span style="color: blue"&gt;var&lt;/span&gt; activeTab = newItem;

        activeTab.ContentMode = &lt;span style="color: #a31515"&gt;"UseIFrame"&lt;/span&gt;;
        newItem.SetActive(); &lt;span style="color: green"&gt;// set the newly created tab item as active

        // insert reference in newly created tab&lt;/span&gt;
        setTimeout(&lt;span style="color: blue"&gt;function&lt;/span&gt; () { activeTab.SetContentURL(name &amp;#43; &lt;span style="color: #a31515"&gt;".aspx"&lt;/span&gt;); }, 50);
    }
    &lt;span style="color: blue"&gt;else&lt;/span&gt; {
        &lt;span style="color: green"&gt;// 1.Raise a simple alert that simply tells the user:
        //   "This tab is already open"; and/or&lt;/span&gt;
        alert(&lt;span style="color: #a31515"&gt;"This tab is already open"&lt;/span&gt;);

        &lt;span style="color: green"&gt;// 2.Simply return the focus on the existing tab, if found in the colletion,
        //   instead of trying to create it.&lt;/span&gt;
        tab.TabPages.GetNamedItem(name).SetActive();
    }
}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebTab - Error with dynamically created tabs   </title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebTab---Error-with-dynamically-created-tabs/</link><pubDate>Mon, 14 Nov 2011 16:24:58 GMT</pubDate><dc:creator>JNguimb</dc:creator><category>WebTab</category><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;The problem is that clicking again on a hyperlink that has its tab still present in the collection raises this error: " &lt;em&gt;WebTab Exception:&lt;/em&gt; &lt;em&gt;Specirfied name "xyz" alread exists in TabPages collection&lt;/em&gt;".&lt;/p&gt;
&lt;p&gt;I need to block this error and, instead, provide one or both of the following two solutions:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Raise a simple&amp;nbsp;alert that simply tells the user: "This&amp;nbsp;tab is already open"; and/or&amp;nbsp;&lt;/li&gt;&lt;li&gt;Simply return the focus on the existing tab, if found in the colletion, instead of trying to create it.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;I have attached a simplified working project (just open DynamicTab.aspx and use the hyperlinks on the left pane to create the tabs).    &lt;/p&gt;
&lt;p&gt;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. &lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;
&lt;p&gt;Jean &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I have attached a simplified working project &lt;/p&gt;</description></item></channel></rss>