New Posts New Posts RSS Feed: Create new Tab View
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Create new Tab View

 Post Reply Post Reply
Author
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Topic: Create new Tab View
    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.

Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post 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

}

Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down