<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Duplicate ViewId&#039;s</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Duplicate ViewId&#039;s</description>
  <pubDate>Wed, 15 Apr 2026 01:46:01 -700</pubDate>
  <lastBuildDate>Thu, 11 Oct 2007 07:27:05 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=486</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Duplicate ViewId&#039;s : Works great. Tx. </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=486&amp;PID=1566#1566</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 486<br /><strong>Posted:</strong> 11-Oct-2007 at 7:27am<br /><br />Works great. Tx. ]]>
   </description>
   <pubDate>Thu, 11 Oct 2007 07:27:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=486&amp;PID=1566#1566</guid>
  </item> 
  <item>
   <title>Duplicate ViewId&#039;s : Congratulations--you&amp;#039;ve found...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=486&amp;PID=1557#1557</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=97" rel="nofollow">Bill Jensen</a><br /><strong>Subject:</strong> 486<br /><strong>Posted:</strong> 10-Oct-2007 at 4:46pm<br /><br />Congratulations--you've found a genuine "undocumented feature" in CAB.&nbsp; It took Ward and myself quite a while to figure it out.<DIV>&nbsp;</DIV><DIV>It turns out that when a view is being built (a consequence of ViewFactory.AddNew&lt;&gt;(), the object builder traverses the view's control hierarchy and adds certain controls to the Items collection of the workitem.&nbsp; These are:</DIV><DIV>&nbsp;</DIV><DIV>SmartParts (doesn't happen often because we rarely add SmartParts statically to a view),</DIV><DIV>&nbsp;</DIV><DIV>Workspaces,</DIV><DIV>&nbsp;</DIV><DIV>and </DIV><DIV>&nbsp;</DIV><DIV>SmartPartPlacehoders.</DIV><DIV>&nbsp;</DIV><DIV>These are added to the workitem Items collection using a key value composed of</DIV><DIV>&nbsp;</DIV><DIV>1.&nbsp; The value of the control's Name property</DIV><DIV>&nbsp;</DIV><DIV>and</DIV><DIV>&nbsp;</DIV><DIV>2.&nbsp; The name of the control's type.</DIV><DIV>&nbsp;</DIV><DIV>If the control's Name property is null, a GUID is used instead.</DIV><DIV>&nbsp;</DIV><DIV>When the first ThreePanelView is created, its SmartPartPlaceholders are added to the items collection using the names mLeftSmartPartPlaceholder, etc.&nbsp; When the second ThreePanelView is created, it attempts to add the same three names and throws the exception.&nbsp; This will happen any time we try to add two instances of a view that contains any of the above three control types.</DIV><DIV>&nbsp;</DIV><DIV>So,&nbsp; the workaround is to give the SmartPartPlaceholders unique&nbsp;(or null) names.&nbsp; This can be done in&nbsp;ThreePanelView in the PresenterReady() method:</DIV><DIV><FONT size=2><P></FONT><FONT color=#808080 size=2>///</FONT><FONT color=#008000 size=2> </FONT><FONT color=#808080 size=2>&lt;summary&gt;</P></FONT><FONT size=2><P></FONT><FONT color=#808080 size=2>///</FONT><FONT color=#008000 size=2> Configure the view once the Presenter declares it is ready.</P></FONT><FONT size=2><P></FONT><FONT color=#808080 size=2>///</FONT><FONT color=#008000 size=2> </FONT><FONT color=#808080 size=2>&lt;/summary&gt;</P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>protected</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>override</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2> PresenterReady(</FONT><FONT color=#008080 size=2>EventArgs</FONT><FONT size=2> e)</P><P>{</P><P></FONT><FONT color=#008000 size=2>// Set the SmartPartPlaceholder names to null so they will be</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>// added to the workitem's Items collection with unique (GUID) names</P></FONT><FONT size=2><P>mLeftSmartPartPlaceholder.Name = </FONT><FONT color=#0000ff size=2>null</FONT><FONT size=2>;</P><P>mMiddleSmartPartPlaceholder.Name = </FONT><FONT color=#0000ff size=2>null</FONT><FONT size=2>;</P><P>mRightSmartPartPlaceholder.Name = </FONT><FONT color=#0000ff size=2>null</FONT><FONT size=2>;</P><P></FONT><FONT color=#008000 size=2>// Assign the view ids to be displayed in the SmartPartPlaceholders</P></FONT><FONT size=2><P>mLeftSmartPartPlaceholder.SmartPartName = ThreePanelViewContext.LeftViewId;</P><P>mMiddleSmartPartPlaceholder.SmartPartName = ThreePanelViewContext.MiddleViewId;</P><P>mRightSmartPartPlaceholder.SmartPartName = ThreePanelViewContext.RightViewId;</P><P>}</P><DIV>Alternatively, we could use:</DIV><DIV><FONT size=2><P></FONT><FONT color=#008000 size=2>mLeftSmartPartPlaceholder.Name = ThreePanelViewContext.LeftViewId+"SPH";</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>mMiddleSmartPartPlaceholder.Name = ThreePanelViewContext.MiddleViewId+"SPH";</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>mRightSmartPartPlaceholder.Name = ThreePanelViewContext.RightViewId+"SPH";</P></FONT></DIV><DIV>Note that we can't create unique names (within the workitem) until the instance of the view is created.&nbsp; Also the designer won't allow setting of null control names.</DIV><DIV>&nbsp;</DIV><DIV>This should get you back on the air.</DIV><DIV>&nbsp;</DIV><DIV>Bill &amp; Ward</DIV></FONT></DIV>]]>
   </description>
   <pubDate>Wed, 10 Oct 2007 16:46:09 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=486&amp;PID=1557#1557</guid>
  </item> 
  <item>
   <title>Duplicate ViewId&#039;s : As a test I add another tab to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=486&amp;PID=1546#1546</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 486<br /><strong>Posted:</strong> 10-Oct-2007 at 12:56pm<br /><br />As a test I add another tab to the Cabana project that uses the MasterDetailTab.<DIV>&nbsp;</DIV><DIV>I added&nbsp;<FONT color=#2b91af size=2>SalesRepCustomers2TabViewController <FONT color=#000000>to the go along with the <FONT color=#2b91af>SalesRepCustomersTabViewController&nbsp;</FONT>&nbsp;tab on the SalesRep page and got the same error.</FONT></FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 10 Oct 2007 12:56:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=486&amp;PID=1546#1546</guid>
  </item> 
  <item>
   <title>Duplicate ViewId&#039;s : I have verified that the Id that...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=486&amp;PID=1530#1530</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 486<br /><strong>Posted:</strong> 10-Oct-2007 at 8:47am<br /><br /><P>I have verified that the Id that is being set changes. This is done by adding the Guid to the panel id (LeftViewId = readonly string for guid + "_Left").&nbsp; </P><DIV><FONT size=2>ViewFactory.AddNew(Constants.</FONT><FONT color=#2b91af size=2>ViewNames</FONT><FONT size=2>.ActionView, WorkItem, LeftViewId);</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>So I do not understand how it is getting only the mLeftSmartPartPlaceholder as the id and causing a duplicate.</DIV></FONT>]]>
   </description>
   <pubDate>Wed, 10 Oct 2007 08:47:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=486&amp;PID=1530#1530</guid>
  </item> 
  <item>
   <title>Duplicate ViewId&#039;s : This error is occuring when the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=486&amp;PID=1528#1528</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 486<br /><strong>Posted:</strong> 10-Oct-2007 at 8:32am<br /><br />This error is occuring when the base ViewFactory.AddNew method is called in the CreateView() method of the BaseTabController (ThreePanelTabVewController). <DIV>&nbsp;</DIV><DIV>In stepping through it I have found that the Guid does change. But for some reason it only uses the last one submitted.</DIV>]]>
   </description>
   <pubDate>Wed, 10 Oct 2007 08:32:27 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=486&amp;PID=1528#1528</guid>
  </item> 
  <item>
   <title>Duplicate ViewId&#039;s : I have created a custom view that...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=486&amp;PID=1527#1527</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=136" rel="nofollow">orcities</a><br /><strong>Subject:</strong> 486<br /><strong>Posted:</strong> 10-Oct-2007 at 8:20am<br /><br />I have created a custom view that will be used on tabs. Same as the Layout Demo's ThreePanelView. When I have more then one tab with this view, using the same type of TabController,&nbsp;I get an error: <DIV>&nbsp;</DIV><DIV>An object with this ID alread exists: mXSmartPartPlaceholder</DIV><DIV>&nbsp;</DIV><DIV><FONT size=2>I have duplicated this error with the LayouDemo example.&nbsp; </FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>I believe this error is created because the ID which contains the Guid is determined at the base TabController, ThreePanelViewTabController, and not at the used TabController, UserRolesTabViewController.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>I am looking at ways to fix this. If anyone comes up with something please let me know.</FONT></DIV><span style="font-size:10px"><br /><br />Edited by orcities - 11-Oct-2007 at 7:50am</span>]]>
   </description>
   <pubDate>Wed, 10 Oct 2007 08:20:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=486&amp;PID=1527#1527</guid>
  </item> 
 </channel>
</rss>