New Posts New Posts RSS Feed: Add controls to ViewFactory
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Add controls to ViewFactory

 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: Add controls to ViewFactory
    Posted: 14-Jan-2008 at 2:26pm
I have my own EditorControl that inherits from the standard editor control. The only difference is the layout of the editor. I do not have tabs but I do have two seperate placeholders to hold the controls.
 
The top view is an edit instance control and the bottom is a grid of all the existing entries. I have already created a tab controller that uses this view.
 
The problem I am running across is that the grid and the edit control are not displaying as I think they should. In the tab control I did the following to get the control to show:
 
override CreateView()

View =        ViewFactory.AddNew(LOC.CEMS.Interface.Constants.ViewNames.SummaryGridView, WorkItem, mSummaryGridIdNumber );

 
override ConfigureContextCore();
CreateGridViewContext();

pContext.GridViewId = GridViewId;

ViewFactory.AddNew(ViewNames.BasicGrid, WorkItem, GridViewId, typeof(ContactAddress));

 

CreateInstanceDetailViewContext();

pContext.SummaryViewId = SummaryViewId;

ViewFactory.AddNew(LOC.CEMS.Rolodex.Constants.ViewNames.AddressView, WorkItem, SummaryViewId);

 
 
So basically I am associated the control to the ID, GridViewId or SummaryViewId, and they are populating just fine. When I try that in the editor control I have created it doesn't work. I have to do the following to get it to work:
 
override AddNewMainView()

ViewFactory.AddNew(LOC.CEMS.Interface.Constants.ViewNames.SummaryGridView, WorkItem, WorkspaceNames.PageContentSmartPartPlaceholder);

 
different CreateView menthods

WorkItem.SmartParts.AddNew<TView>(LOC.CEMS.Interface.Constants.WorkspaceNames.InstanceDetailSmartPartPlaceholder);

ViewFactory.AddNew(ViewNames.BasicGrid, WorkItem, LOC.CEMS.Interface.Constants.WorkspaceNames.GridSmartPartPlaceholder, typeof(TEntity));

If I try going by Id like I did in the tab controller it doesn't work. Nothing shows up. What would be the reason I would have to go by the workspace name to get it to display. It should go by the Identifiable Id that I gave in the View itself like the tab controller does..
Back to Top
DeLight View Drop Down
Newbie
Newbie


Joined: 23-Aug-2007
Location: Belarus
Posts: 15
Post Options Post Options   Quote DeLight Quote  Post ReplyReply Direct Link To This Post Posted: 15-Jan-2008 at 12:43am
the main and only law in displaying views via SmartPartPlaceholders is "view with BuilderID='ID' will be shown only in the SPP with SmartPartName='ID'". and of course view and SPP must belong to one WorkItem. no other rules exist.
so try to check this ids via WorkItemVisualizer, somewhere they are not equal. pay attention that for example MasterDetailControllers assign IDs to views as MakeViewSpecificId(smth) because several MasterDetailControllers can exist in one workitem.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down