<?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 : [SOLVED] ListConverters</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : [SOLVED] ListConverters</description>
  <pubDate>Thu, 11 Jun 2026 20:52:56 -700</pubDate>
  <lastBuildDate>Tue, 18 Sep 2007 16:56:59 -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=424</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>[SOLVED] ListConverters : Here&amp;#039;s the 411:   1) Enter...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1210#1210</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 424<br /><strong>Posted:</strong> 18-Sep-2007 at 4:56pm<br /><br />Here's the 411: <DIV>&nbsp;</DIV><DIV>1)&nbsp; Enter the ListConverter name pairs for each list involved (e.g. Shipper and ShipperID) in the ListConverterNames.cs file&nbsp;in the Interface.Constants project/folder.</DIV><DIV>2)&nbsp; Add the pair to the CreateServiceItemCore method of the ListConverterService (Foundation Module)</DIV><DIV>Market example:</DIV><DIV><BR><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#2b91af size=2>ListConverterNames</FONT><FONT size=2>.MarketList):<BR></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> MakeMarketListConverter();<BR></FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#2b91af size=2>ListConverterNames</FONT><FONT size=2>.MarketIDList):<BR></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> MakeMarketIDListConverter();</DIV></FONT><DIV>&nbsp;</DIV><DIV>3)&nbsp; Create the MakeListConverter methods...one for each of the pair</DIV><DIV>Market example:</DIV><DIV><BR><FONT color=#808080 size=2>///</FONT><FONT color=#008000 size=2> </FONT><FONT color=#808080 size=2>&lt;summary&gt;</FONT><FONT color=#008000 size=2> Make the global ListConverter for all Markets; </FONT><FONT color=#808080 size=2>&lt;/summary&gt;<BR></FONT><FONT color=#0000ff size=2>private</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>ListConverter</FONT><FONT size=2> MakeMarketListConverter()<BR>{<BR></FONT><FONT color=#2b91af size=2>EntityListConverter</FONT><FONT size=2>&lt;</FONT><FONT color=#2b91af size=2>MarketMaster</FONT><FONT size=2>&gt; converter = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>EntityListConverter</FONT><FONT size=2>&lt;</FONT><FONT color=#2b91af size=2>MarketMaster</FONT><FONT size=2>&gt;(EntityManager, </FONT><FONT color=#2b91af size=2>EntityPropertyDescriptors</FONT><FONT size=2>.MarketMaster.MarketMstrDesc.Name, </FONT><FONT color=#2b91af size=2>Editability</FONT><FONT size=2>.Optional);<BR>AddListManager_KeepExistingEntitiesOnly(converter);<BR></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> converter;<BR>}<BR></FONT><FONT color=#808080 size=2>///</FONT><FONT color=#008000 size=2> </FONT><FONT color=#808080 size=2>&lt;summary&gt;<BR></FONT><FONT color=#808080 size=2>///</FONT><FONT color=#008000 size=2> Make the global ListConverter for all Markets which can be Customers; <BR></FONT><FONT color=#808080 size=2>///</FONT><FONT color=#008000 size=2> use with a MarketMstrIdx property.<BR></FONT><FONT color=#808080 size=2>///</FONT><FONT color=#008000 size=2> </FONT><FONT color=#808080 size=2>&lt;/summary&gt;<BR></FONT><FONT color=#0000ff size=2>private</FONT><FONT size=2> </FONT><FONT color=#2b91af size=2>ListConverter</FONT><FONT size=2> MakeMarketIDListConverter()<BR>{<BR></FONT><FONT color=#2b91af size=2>ListConverter</FONT><FONT size=2> converter = CopyConverter&lt;</FONT><FONT color=#2b91af size=2>MarketMaster</FONT><FONT size=2>&gt;</FONT><FONT color=#2b91af size=2>ListConverterNames</FONT><FONT size=2>.MarketList);<BR></FONT><FONT color=#008000 size=2>// Matches and updates the *Id* (index) rather than the Market object<BR></FONT><FONT size=2>converter.ValueMember = </FONT><FONT color=#2b91af size=2>EntityPropertyDescriptors</FONT><FONT size=2>.MarketMaster.MarketMstrIdx.Name;<BR></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> converter;<BR>}</FONT></DIV><DIV><FONT size=2>&nbsp;</DIV></FONT><DIV>4) Bind the lists in the view's presenter</DIV><DIV>Market example:<BR><BR><FONT color=#2b91af size=2>EntityPropertyDescriptors</FONT><FONT size=2>.</FONT><FONT color=#2b91af size=2>CustomerMasterPropertyDescriptor</FONT><FONT size=2> descriptors = </FONT><FONT color=#2b91af size=2>EntityPropertyDescriptors</FONT><FONT size=2>.CustomerMaster;<BR>SetBindingListConverter(descriptors.MarketMaster, </FONT><FONT color=#2b91af size=2>ListConverterNames</FONT><FONT size=2>.MarketList);<BR>SetBindingListConverter(descriptors.Market, </FONT><FONT color=#2b91af size=2>ListConverterNames</FONT><FONT size=2>.MarketIDList);</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Note:&nbsp; make sure that these bindings fire before the base.OnViewSet().</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>5)&nbsp; When binding the loose controls, add the index/ID field (not the entity)...make sure to change the control to a comboxbox.&nbsp; Leave all defaults in the ListConverter</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Build and run.&nbsp; That seems to work for me.&nbsp; It is a bit different than standard DevForce binding.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Again, for more examples, please see the Shared Editor module of the Cabana app.</DIV></FONT><span style="font-size:10px"><br /><br />Edited by Linguinut - 18-Sep-2007 at 4:58pm</span>]]>
   </description>
   <pubDate>Tue, 18 Sep 2007 16:56:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1210#1210</guid>
  </item> 
  <item>
   <title>[SOLVED] ListConverters : Btw, I am now referencing the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1205#1205</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 424<br /><strong>Posted:</strong> 18-Sep-2007 at 2:29pm<br /><br />Btw, I am now referencing the SharedEditor for a little better example.]]>
   </description>
   <pubDate>Tue, 18 Sep 2007 14:29:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1205#1205</guid>
  </item> 
  <item>
   <title>[SOLVED] ListConverters : Sorry for the contradiction. The...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1204#1204</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 424<br /><strong>Posted:</strong> 18-Sep-2007 at 2:22pm<br /><br />Sorry for the contradiction.&nbsp; The AutoValidate property of the form is not the issue, anyway. <DIV>&nbsp;</DIV><DIV>The DevForce Object Mapper was used to create the business objects being referenced.&nbsp; The ControlBindingManager is used to populate the view with loose controls based on the selected bound type.&nbsp; I am following all DevForce protocols for creating a databound combobox...I have done this dozens of times in a non-CAB environments.&nbsp; I drag the desired entitylist for autopopulation, then verify that the dataconverter is set to ListConverter, then (following the CAB example for TitleOfCourtesy) I set the DisplayMember to the appropriate property (valuemember is __Self).&nbsp; The SetBindingListConverter&nbsp;(see above)&nbsp;*does* populate the combobox, but no item is selected when the main entity (Customer)&nbsp;is displayed on the view.&nbsp; Even if I select a value from any combobox, then navigate away from the entity (or simply away from the combobox!), when I return no value is selected.</DIV><DIV>&nbsp;</DIV><DIV>Somehow, I am not tying the ListConverter from the ListConverterService to the one created by the ControlBindingManager.</DIV><span style="font-size:10px"><br /><br />Edited by Linguinut - 18-Sep-2007 at 2:32pm</span>]]>
   </description>
   <pubDate>Tue, 18 Sep 2007 14:22:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1204#1204</guid>
  </item> 
  <item>
   <title>[SOLVED] ListConverters : You wrote: EnablePreventFocusChange...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1202#1202</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> 424<br /><strong>Posted:</strong> 18-Sep-2007 at 1:56pm<br /><br /><P>You wrote:</P><DIV><FONT color=#0066ff>EnablePreventFocusChange is the option that I desire; however, it does not work--the screen is still "stuck";</FONT></DIV><DIV>&nbsp;</DIV><DIV>This seems contradictory--"EnablePreventFocusChange" will prevent shifting the focus away from the control while the value is invalid.&nbsp; I.e., the cursor will be "stuck".&nbsp; Which do you want?</DIV><DIV>&nbsp;</DIV><DIV>It sounds like the list is working fine--the problem is that the bound value of the control isn't showing up.</DIV><DIV>&nbsp;</DIV><DIV>Are you sure there is an entity to bind to and that its bound property has a legal value?</DIV><DIV>&nbsp;</DIV><DIV>Was the binding created with the DevForce Object Mapper?</DIV><DIV>&nbsp;</DIV><DIV>Is the bound property of the proper type?&nbsp; Of the same type as the ValueMember specification of the ListConverter?</DIV><DIV>&nbsp;</DIV><DIV>Bill J.</DIV>]]>
   </description>
   <pubDate>Tue, 18 Sep 2007 13:56:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1202#1202</guid>
  </item> 
  <item>
   <title>[SOLVED] ListConverters : Not sure. I did recreate the code...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1199#1199</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 424<br /><strong>Posted:</strong> 18-Sep-2007 at 12:43pm<br /><br /><P>Not sure.&nbsp; I did recreate the code in my view and presenter.</P><DIV>Several problems:</DIV><DIV></DIV>1)&nbsp; EnablePreventFocusChange is the option that I desire; however, it does not work--the screen is still "stuck"; <DIV>2)&nbsp; EnableAllowFocusChange allows the user to move between controls (the "stuck" part is taken care of); however, the proper list item is still *not* selected.</DIV><DIV>3)&nbsp; The Inherit and Disable options seem like they may violate other desireable features (validation, etc.).</DIV><DIV>&nbsp;</DIV><DIV>So, I guess my original question about the binding still needs to be addressed.&nbsp; How do I fill a list from a listconverter and select the proper item based on the object in view?&nbsp; It just seems like the order of binding is swapped somehow.&nbsp; Is&nbsp;there a different way&nbsp;to bind the lists earlier than the view?</DIV><DIV>&nbsp;</DIV><DIV>Of course, I may not even be asking the right question, either.&nbsp; I am still learning.&nbsp; Thanks for being patient with me.</DIV><DIV>&nbsp;</DIV><DIV>Bill</DIV>]]>
   </description>
   <pubDate>Tue, 18 Sep 2007 12:43:28 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1199#1199</guid>
  </item> 
  <item>
   <title>[SOLVED] ListConverters : How is your view&amp;#039;s AutoValidation...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1193#1193</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> 424<br /><strong>Posted:</strong> 18-Sep-2007 at 10:49am<br /><br />How is your view's AutoValidation property set?&nbsp; <DIV>&nbsp;</DIV><DIV>(AutoValidate is a property of System.Windows.Forms.UserControl)</DIV><DIV>&nbsp;</DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV>In SalesRepGeneralView, at line 38&nbsp;we see:<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;</FONT><FONT color=#008000 size=2>Configure the presenter for this view.</FONT><FONT color=#808080 size=2>&lt;/summary&gt;</P><DIV></FONT><FONT size=2></FONT><FONT color=#808080 size=2>///</FONT><FONT color=#008000 size=2> </FONT><FONT color=#808080 size=2>&lt;remarks&gt;</DIV></FONT><FONT size=2><P></FONT><FONT color=#808080 size=2>///</FONT><FONT color=#008000 size=2> Configuration that can be done immediately after setting </P></FONT><FONT size=2><P></FONT><FONT color=#808080 size=2>///</FONT><FONT color=#008000 size=2> the Presenter's View reference.</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;/remarks&gt;</P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>private</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2> ConfigurePresenter(</FONT><FONT color=#008080 size=2>SalesRepGeneralViewPresenter</FONT><FONT size=2> pPresenter) {</P><P>pPresenter.BindCountryControl(mCountryTextBox);</P><P>pPresenter.AgePlausibilityEvent += AgePlausibilityEventHandler;</P><P>AutoValidate = pPresenter.SetAutoValidation();</P><P>}</P><DIV></DIV><DIV>In it's presenter, at line 54&nbsp;we see:</DIV><DIV>&nbsp;</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;</FONT><FONT color=#008000 size=2>Set how the View constrains focus change when validation fails.</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> </FONT><FONT color=#808080 size=2>&lt;remarks&gt;</FONT><FONT color=#008000 size=2>Can also disable auto validation altogether.</FONT><FONT color=#808080 size=2>&lt;/remarks&gt;</P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>public</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>AutoValidate</FONT><FONT size=2> SetAutoValidation() {</P><P></FONT><FONT color=#008000 size=2>// Play with the choices.</P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>AutoValidate</FONT><FONT size=2>.EnablePreventFocusChange; </FONT><FONT color=#008000 size=2>// Locked in control</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//return AutoValidate.EnableAllowFocusChange; // Can move</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//return AutoValidate.Inherit; // Do what the parent container does</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//return AutoValidate.Disable; // Don't autovalidate.</P></FONT><FONT size=2><P>}</P><DIV>Have you tried playing around with these values to get the behavior you want?</DIV><DIV>&nbsp;</DIV><DIV>Bill J.</DIV></FONT></FONT></DIV>]]>
   </description>
   <pubDate>Tue, 18 Sep 2007 10:49:04 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1193#1193</guid>
  </item> 
  <item>
   <title>[SOLVED] ListConverters : These are still a bit enigmatic...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1165#1165</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 424<br /><strong>Posted:</strong> 12-Sep-2007 at 7:46pm<br /><br /><P>These are still a bit enigmatic within the CAB.&nbsp; Could someone walk me through implementing a new, data-dependent ListConverter?</P><DIV>Thanks,</DIV><DIV>Bill</DIV>]]>
   </description>
   <pubDate>Wed, 12 Sep 2007 19:46:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1165#1165</guid>
  </item> 
  <item>
   <title>[SOLVED] ListConverters : I created a new presenter for...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1147#1147</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 424<br /><strong>Posted:</strong> 11-Sep-2007 at 11:38am<br /><br />I created a new presenter for the view that was created by the wizard.&nbsp; Within the presenter I added the code to set the list converter, as follows:<DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>SetBindingListConverter(</FONT><FONT color=#2b91af size=2>CustomerMaster</FONT><FONT size=2>.Descriptors.MarketMaster, </FONT><FONT color=#2b91af size=2>ListConverterNames</FONT><FONT size=2>.MarketList);</DIV></FONT><DIV>&nbsp;</DIV><DIV>I am following the Cabana example app.&nbsp; The problem is that when the view is displayed, the list is filled properly; however, the screen is "stuck" in that combobox.&nbsp; No value is selected for any combobox with an assigned ListConverter (total of three on this view).&nbsp; I am forced to select an item from the list, then I can move to another field or even another page.</DIV><DIV>&nbsp;</DIV><DIV>This is odd behavior.&nbsp; I must be missing some little thing within the framework.</DIV><DIV>&nbsp;</DIV><DIV>Thanks, in advance,&nbsp;for any help,</DIV><DIV>Bill</DIV>]]>
   </description>
   <pubDate>Tue, 11 Sep 2007 11:38:30 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1147#1147</guid>
  </item> 
  <item>
   <title>[SOLVED] ListConverters : In the Cabana sample application...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1145#1145</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 424<br /><strong>Posted:</strong> 11-Sep-2007 at 10:30am<br /><br />In the Cabana sample application the&nbsp;list converters are created in the presenter.&nbsp; When I created a new search summary detail page, no presenter was created with the summary control.&nbsp; I have three lists that I need to fill on the page.&nbsp; I have created the lists using the service in the foundation module.&nbsp; What is the best way to do this? <span style="font-size:10px"><br /><br />Edited by Linguinut - 19-Sep-2007 at 12:30pm</span>]]>
   </description>
   <pubDate>Tue, 11 Sep 2007 10:30:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=424&amp;PID=1145#1145</guid>
  </item> 
 </channel>
</rss>