﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WebForms (How do I?)  » SfWeb Dropdownlist populating</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 31 May 2026 07:02:07 GMT</lastBuildDate><ttl>20</ttl><item><title>SfWeb Dropdownlist populating</title><link>http://forum.strataframe.net/FindPost31268.aspx</link><description>Hi all,&lt;br/&gt;&lt;br/&gt;I don't find any example or tutorial to populating a dropdownlist with a business object.&lt;br/&gt;&lt;br/&gt;I try two way :&lt;br/&gt;&lt;br/&gt;&amp;lt;SFWeb:DropDownList ID="DropDownList1" runat="server" BusinessObjectName="oTMessageBo" DataTextField="TMES_LIBELLE" DataValueField="TMES_ID" &amp;gt;&lt;br/&gt;&amp;lt;/SFWeb:DropDownList&amp;gt;&lt;br/&gt;&lt;br/&gt;or&lt;br/&gt;&lt;br/&gt;&amp;nbsp;&amp;lt;SFWeb:DropDownList ID="DDL_TMESSAGE" runat="server"&amp;gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;PopulationDataSourceSettings BusinessObjectType="oTMessageBo" DisplayFieldNamesAlternate="TMES_LIBELLE|" DropDownFormatString="" FormatString="{0}" MethodToExecute="GetYesNo;" ValueMember="TMES_ID" /&amp;gt;&lt;br/&gt;&amp;nbsp;&amp;lt;/SFWeb:DropDownList&amp;gt;&lt;br/&gt;&lt;br/&gt;Have you an idea ?&lt;br/&gt;&lt;br/&gt;I work in c# asp.net with strata.&lt;br/&gt;&lt;br/&gt;thanks&lt;br/&gt;Olivier,&lt;br/&gt;&lt;br/&gt;</description><pubDate>Mon, 16 Jul 2012 15:17:09 GMT</pubDate><dc:creator>Olivier</dc:creator></item><item><title>RE: SfWeb Dropdownlist populating</title><link>http://forum.strataframe.net/FindPost31273.aspx</link><description>He he Olivier,&lt;br/&gt;&lt;br/&gt;Did you forgot all we've learn on the SF session I gave you? :Whistling: That method (FillDataAllFields) is the one&amp;nbsp;we wrote together as an example on one of your BOs...&lt;br/&gt;&lt;br/&gt;You may write whatever you want in a custom Fill method, including WHERE clause and/or JOIN and/or ORDER, etc etc... all this will run on the SQL server as long the syntax you use is T-SQL syntax for your version of the engine (I mean SQL 2000 will not understand a CTE, for example).&lt;br/&gt;A single BO may host as many custom fill method you need, and all these methods will be available to fill it from within any aspx page based on a default page in which you create an instance of this BO. Simply code what you need in the BO, consume it where you need.&lt;br/&gt;In my own BOs, around half of the fill methods are specifics one for populating DropDownLists, Combos, and lists (I query only the columns I need).&lt;br/&gt;&lt;br/&gt;For the empty or additional&amp;nbsp;line on top of the Combo, look at the &lt;strong&gt;TopMostDescription&lt;/strong&gt; property, it is intended for that usage (see also &lt;strong&gt;TopMostDropDown&lt;/strong&gt; and &lt;strong&gt;TopMostValue&lt;/strong&gt;)&lt;br/&gt;&lt;br/&gt;-------------------------------------------------------&lt;br/&gt;&lt;br/&gt;Oh Olivier,&lt;br/&gt;&lt;br/&gt;Tu as oublié tout ce qu'on a vu pendant la formation que j'ai faite chez toi :Whistling: Cette méthode (FillDataAllFields), c'est celle qu'on a écrite ensemble comme exemple sur un de tes BOs...&lt;br/&gt;&lt;br/&gt;Tu peux écrire ce que tu veux dans une méthode Fill, y compris avec des WHERE, des JOIN, des ORDER, etc etc... tout ça sera éxécuté sur le serveur SQL si ta syntaxe respecte le T-SQL de ta version (je veux dire que par exemple un SQL 2000 ne comprendra pas une requète avec une CTE).&lt;br/&gt;Un BO peut héberger autant de requètes Fill personnalisées que tu veux, toutes ces méthodes seront disponibles pour peupler le BO depuis une page aspx dérivée d'une basepage dans laquelle tu auras créé une instance de ce BO. Tu as juste à coder dans le BO, et tu utilises ce que tu veux quand tu en as besoin.&lt;br/&gt;Dans mes BOs, environ la moitié des méthodes fill sont destinées à peupler des listes déroulantes et des combos (je requète uniquement les colonnes dont j'ai besoin).&lt;br/&gt;&lt;br/&gt;Pour ce qui concerne la ligne vide ou supplémentaire en haut du combo, regarde la propriété &lt;strong&gt;TopMostDescription&lt;/strong&gt;, elle est justement faite pour ça! (regarde aussi &lt;strong&gt;TopMostDropDown&lt;/strong&gt; et &lt;strong&gt;TopMostValue&lt;/strong&gt;)</description><pubDate>Mon, 16 Jul 2012 15:17:09 GMT</pubDate><dc:creator>Michel Levy</dc:creator></item><item><title>RE: SfWeb Dropdownlist populating</title><link>http://forum.strataframe.net/FindPost31272.aspx</link><description>Hi Michel,&lt;br/&gt;&lt;br/&gt;Thanks For your reply,&lt;br/&gt;&lt;br/&gt;i don't understand the method : "&lt;span id="ctl00_ctlContentPlaceHolder_ctl00_ctlTopic_ctlPanelBar_ctlTopicsRepeater_ctl02_lblFullMessage"&gt;&lt;/span&gt;FillDataAllFields" and after i understand , it's your custom method.&lt;br/&gt;&lt;br/&gt;It's work very well.&lt;br/&gt;&lt;br/&gt;it's possible to have a filter "where" on executemethod ? to load a several record.&lt;br/&gt;And if possible to add an empty record on the top.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Merci beaucoup michel pour ta réponse.&lt;br/&gt;&lt;br/&gt;Je n'avais pas compris la methode FillDataAllFields et puis j'ai compris que c'etait une methode personnel que tu avais faites.&lt;br/&gt;Si tu connais le moyen de faire un where sur la requete dans le populating, car j'ai fait une methode custom aussi.&lt;br/&gt;Et si possible rajouter un enregistrement vide au début du style : "Faites votre choix"&lt;br/&gt;&lt;br/&gt;Merci pour tout,&lt;br/&gt;&lt;br/&gt;thanks&lt;br/&gt;Olivier,</description><pubDate>Mon, 16 Jul 2012 12:39:07 GMT</pubDate><dc:creator>Olivier</dc:creator></item><item><title>RE: SfWeb Dropdownlist populating</title><link>http://forum.strataframe.net/FindPost31270.aspx</link><description>Salut Olivier,&lt;br/&gt;&lt;i&gt;Hi Olivier,&lt;/i&gt;&lt;br/&gt;&lt;br/&gt;quand tu utilises un controle SF aspx pour la première fois, je te conseille de commencer par utiliser le mode de design. Comme ça, tu peux repérer dans la feuille de propriétés ce qui est nécessaire pour cette classe SF.&lt;br/&gt;&lt;i&gt;When you begin with a new SF aspx control, my advice would be to begin with using design mode. I find it more simple, in order to see in the property sheet what is mandatory for this SF class.&lt;/i&gt;&lt;br/&gt;&lt;br/&gt;par exemple, ici,&lt;br/&gt;&lt;i&gt;as an example, see below&lt;/i&gt;&lt;br/&gt;&lt;br/&gt;&lt;img src="http://forum.strataframe.net/Uploads/Images/f167d5e8-0e7c-4ba7-9f9f-0ca4.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;on voit bien qu'il faut renseigner le PopulationType et le PopulationDataSource. Tu commences par le PopulationType, en choisissant "BusinessObject"&lt;br/&gt;&lt;i&gt;One can see that PopulationType and PopulationDataSource are 2 required properties. Set the PopulationType first, by choosing "BusinessObject"&lt;/i&gt;&lt;br/&gt;&lt;br/&gt;Ensuite, tu peux configurer le PopulationDataSourceSettings, ça te propose un assistant:&lt;br/&gt;&lt;i&gt;Now, you can configure the PopulationDataSourceSettings, you'll see the wizard:&lt;/i&gt;&lt;br/&gt;&lt;br/&gt;&lt;img src="http://forum.strataframe.net/Uploads/Images/a836c24d-f15e-4559-af0e-39b6.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;Tu choisis le BO parmi ceux de ton projet, la méthode à éxécuter pour peupler la liste, et les colonnes à afficher.&lt;br/&gt;&lt;i&gt;Choose the BO from the list coming from your project, the method to execute for populate the list, and the columns to show.&lt;/i&gt;&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Au final, tu obtiens du code comme celui-ci, par exemple:&lt;br/&gt;&lt;i&gt;Finally, your code should be as this example:&lt;/i&gt;&lt;br/&gt;&lt;br/&gt;[code]&lt;br/&gt;&lt;br/&gt;&lt;pRE style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; font-size: 13px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;SFWeb&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;DropDownList&lt;/span&gt;&amp;nbsp;&lt;span style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"DropDownList1"&lt;/span&gt;&amp;nbsp;&lt;span style="COLOR: red"&gt;runat&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"server"&lt;/span&gt;&amp;nbsp;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="COLOR: red"&gt;PopulationType&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"BusinessObject"&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;br/&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;PopulationDataSourceSettings&lt;/span&gt;&amp;nbsp;&lt;span style="COLOR: red"&gt;BusinessObjectType&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"TestBO.BOaffaires"&lt;/span&gt;&amp;nbsp;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="COLOR: red"&gt;DisplayFieldNamesAlternate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"ville|anconstruc|"&lt;/span&gt;&amp;nbsp;&lt;span style="COLOR: red"&gt;DropDownFormatString&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;""&lt;/span&gt;&amp;nbsp;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="COLOR: red"&gt;FormatString&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"{0}{1}"&lt;/span&gt;&amp;nbsp;&lt;span style="COLOR: red"&gt;MethodToExecute&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"FillDataAllFields;"&lt;/span&gt;&amp;nbsp;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="COLOR: red"&gt;ValueMember&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;span style="COLOR: blue"&gt;"bi_id"&lt;/span&gt;&amp;nbsp;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;br/&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;SFWeb&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;DropDownList&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/PRE&gt;[/code]&lt;br/&gt;&lt;br/&gt;Est-ce plus clair?</description><pubDate>Sat, 14 Jul 2012 05:41:49 GMT</pubDate><dc:creator>Michel Levy</dc:creator></item></channel></rss>