Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
300
WebTab will not add new tab after initial addition or deletion
posted

First Issue: 

I  have a WebDataMenu that drives what tabs are created in the WebTab.  If you select an item in the WebDataMenu, a new tab is created.  Great. If you delete that tab, it's removed. Great. Now, go to the WebDataMenu and select another item--no tab is loaded this time.  The code-behind here is firing, and the function completes it's action, but the WebTab never updates appropriately.

**Update** It's not just the delete--once I add a tab, it will no longer add additional tabs either. 

The WebTab

 <ig:WebTab ID="UCContainer" runat="server" Width="100%" height="100%"

            TabLocation="BottomLeft" AutoPostBackFlags-TabClosed="Async"  

            EnableActivation="True" OnTabItemClosed="UCContainer_TabItemClosed">

            <ClientEvents Loaded="WebTab_Load" TabClosed="WebTab_Load" />

            <Tabs>

                <ig:ContentTabItem runat="server" Text="Workspace" EnableCloseButton="False">

                </ig:ContentTabItem>

            </Tabs>

            <CloseButton Enabled="True" />

            <ContentPane AutoSize="True">

            </ContentPane>

            <PostBackOptions EnableAjax="True" />

            <TabMoving Enabled="True" />

        </ig:WebTab>

The Function to Add Tabs 

 

void _master_MenuItemSelected(object sender, ClientCommon.MenuItemSelectedEventArgs args)

        {

            ContentTabItem _Item = new ContentTabItem();

            _Item.Text = args.ItemName;

            _Item.ContentUrl = args.ItemUrl;

 

            UCContainer.Tabs.Add(_Item);

 

            UCContainer.SelectedIndex = UCContainer.Tabs.IndexOf(_Item);

        }

 

 

 

The Second Issue: 

The first tab in the collection is the user's Workspace--this tab will never be deleted, as the tab close button is hidden on this element. If a user adds a new tab, then deletes it, I want to set the SelectedIndex property to the previous tab in the list. If there are two tabs 'Workspace being index 0' and 'NewTab being index 1', when 'NewTab' is closed, I want to set the focus back to the 'Workspace' tab.  Here is the code that I have in place to attempt to do this--you will see that the event is plugged into the smart tag for the WebTab above: 

 

protected void UCContainer_TabItemClosed(object sender, TabItemEventArgs e)

        {

            int _selIndex = UCContainer.Tabs.IndexOf(e.TabItem) - 1;

            UCContainer.SelectedIndex = _selIndex;

        }

This doesn't work--the selected index is set on the server side, but that selection is never reflected on the client side. 

 

 

Any help is greatly appreciated. 

Parents
No Data
Reply
  • 13438
    posted

    Hello Anthony.

    I know a couple of months have passed since you asked this issue but I would be glad if I can help. Please take a look at the attached from me sample via 11.2.20112.1019 and is made based on your code snippets and scenario. The first issue is not reproducible. The second issue got resolved after removing Async postback and setting it to full when tab is closed which causes full rendering of the control.

    79057_WDM.zip
Children
No Data