Print Page | Close Window

Create new Tab View

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1205
Printed Date: 23-Apr-2025 at 9:03pm


Topic: Create new Tab View
Posted By: orcities
Subject: Create new Tab View
Date Posted: 07-Apr-2009 at 11:08am
I am trying to create a new tab view that will be added to an existing tab. It all compiles but my tabs do not populate.
 
Any suggestions?
 
In my View:

public override void CreateView()

{

    CreateTabViewContext();

    View =

      ViewFactory.AddNew(LOC.CEMS.EventManagement.Constants.ViewNames.NestedTabView, WorkItem, mNestedTabIdNumber);

   

    CreateTabs();

 

    TabViewControllers.ShowInTabWorkspace(((INestedTabView)View).TabsWorkspace);

 

}

 

/// <summary>Create the Tabs.</summary>

/// <remarks>Typically make use of <see cref="TabViewControllers"/>.</remarks>

protected void CreateTabs()

{

    AddTabs();

    TabViewControllers.CreateView();

}

 

/// <summary>

/// Create the SummaryGridView

/// </summary>

private void CreateTabViewContext()

{

    NestedTabViewContext context =

      NestedTabViewContext.AddNew(WorkItem, mNestedTabIdNumber);

    ConfigureTabViewContextCore(context);

    }

 

From my understanding TabViewControllers.ShowInTabWorkspace should add the tabs to the control. The list is populated but nothing gets added.




Replies:
Posted By: orcities
Date Posted: 08-Apr-2009 at 2:17pm
I can not get the tabs to populate. What am I doing wrong. I am doing bear minimum right now. The control loads but the tabs do not.
 

/// <summary>

/// Build a TabView controller that uses the SummaryDetailView

/// </summary>

public class SummaryDetailTabController : TabViewController

{

#region Ctor

/// <summary>Ctor, defaulted to an inactive tab when first shown.</summary>

public SummaryDetailTabController()

    : this(false) { }

 

/// <summary>Ctor.</summary>

/// <param name="pIsFirstActiveTab">

/// <see langword="truen"/> if this will be the active tab when first shown.

/// </param>

public SummaryDetailTabController(bool pIsFirstActiveTab)

    : base(pIsFirstActiveTab)

{

}

#endregion

 

#region TabViewController overrides

 

/// <summary>

/// Create the MasterDetail view and it's member views,

/// then add them to WorkItem SmartParts.

/// </summary>

public override void CreateView()

{

    CreateDetailTabs();

    CreateSummaryDetailView();

}

 

/// <summary>Configure the view-specific events, often responding to BindingSource events.</summary>

public override void ConfigureEvents()

{

   

}

 

/// <summary>Refresh the view.</summary>

public override void Refresh(IAppView pActiveView)

{

   

}

 

/// <summary>Set the View's Tab's SmartPartInfo within the

/// <see cref="TabViewController.ShowInTabWorkspace"/> phase.</summary>

protected override TabSmartPartInfo SetSmartPartInfo()

{

    ///<example>

    return SmartPartInfoFns.MakeTabSmartPartInfo("SummaryDetailTab", "MasterLabelText", IsFirstActiveTab);

    ///</example>

}

#endregion

 

#region CreateView additions

 

/// <summary>Create SummaryDetailView</summary>

private void CreateSummaryDetailView()

{

    //int summaryHeight = mSummaryView.PreferredHeight;

    View = mSummaryDetailView = (ISummaryDetailView)

      ViewFactory.AddNew(ViewNames.SummaryDetail, WorkItem, mSummaryDetailIdNumber);

    mSummaryDetailView.PreferredSummaryViewHeight = 0;// summaryHeight;

    //if (mTabViewControllers.Count == 0) mSummaryDetailView.DetailViewCollapsed = true;

}

 

/// <summary>Create the DetailTabs.</summary>

/// <remarks>Typically make use of <see cref="TabViewControllers"/>.</remarks>

protected void CreateDetailTabs()

{

    AddDetailTabs();

    TabViewControllers.CreateView();

}

#endregion

 

#region Abstract

/// <summary>Add the DetailTabs.</summary>

/// <remarks>

/// Typically make use of <see cref="TabViewControllers"/>.

/// See <see cref="CreateDetailTabs"/>.

/// </remarks>

protected void AddDetailTabs()//protected abstract void AddDetailTabs();

{

    TabViewControllers.Add(new GeneralTabViewController<FacilityCapacityView>("Capacity", "Capacity Info", true));

}

#endregion

 

#region Members

 

/// <summary>The list of <see cref="TabViewController"/> objects that

/// create, configure, and manage the views in the Detail TabPages.</summary>

protected TabViewControllerList TabViewControllers

{

    get

    {

        if (mTabViewControllers == null)

        {

            mTabViewControllers = WorkItem.Items.AddNew<TabViewControllerList>();

        }

        return mTabViewControllers;

    }

}

#endregion

 

 

#region Other Private

private string SummaryViewId

{

    get { return msSummaryDetailViewIdBase + mSummaryDetailIdNumber; }

}

#endregion

 

#region Fields

private ISummaryDetailView mSummaryDetailView;

private IBindingView mSummaryView;

 

private TabViewControllerList mTabViewControllers;

private const string msSummaryDetailViewIdBase = "SummaryDetail_";

 

private readonly string mSummaryDetailIdNumber = Guid.NewGuid().ToString();

#endregion

}



Posted By: orcities
Date Posted: 08-Apr-2009 at 2:44pm

In this version I am missing

TabViewControllers.ShowInTabWorkspace(mSummaryDetailView.DetailsWorkspace);

In my more comlicated versions I had it. But, I may have been adding it to the work workspace.



Print Page | Close Window