﻿<?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 » Issues  » Cant use a Function to populate a combo box</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 30 May 2026 06:48:40 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost13144.aspx</link><description>Merry Christmas to you as well :)</description><pubDate>Fri, 21 Dec 2007 13:50:24 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost10920.aspx</link><description>When I setup the PopulationDataSourceSettings on a combo box, I am trying to use a FillAll function which return the count of records in the BO after the fill.&amp;nbsp; I dont care about the return value when filling the combo, but I still want to use the FillAll function to fill it.&amp;nbsp; However, it's not available in the Method to Execute dropdown unless it's a Sub.&amp;nbsp; Is there anything that can be done about this or some reason it is like this that I'm not understanding?</description><pubDate>Fri, 21 Dec 2007 13:50:24 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost13141.aspx</link><description>Great, thanks Trent.&amp;nbsp; All I wanted was an approximate time frame, so that works for me.&amp;nbsp; Thanks for getting the fix in there too.&amp;nbsp; Have a good Christmas!&amp;nbsp; Don't work the whole time.</description><pubDate>Fri, 21 Dec 2007 13:16:28 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost13129.aspx</link><description>[quote]Also, any idea when we might have a new release? [/quote]&lt;/P&gt;&lt;P&gt;We have already decided that we will reflect the functions as well in the next update.&amp;nbsp; As for an exact date on the new release, I cannot give you one.&amp;nbsp; We had initially hoped to get one out before Christmas, but we have added a phenominal amount of enhancements including VS 2008 support, so we have been slow to release until we have gone through a thorough QA cycle.&amp;nbsp; So it will probably be January sometime that we publish the new update.</description><pubDate>Fri, 21 Dec 2007 09:19:07 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost13120.aspx</link><description>Seems like a simple enough correction within the framework; however, that may get a bit messy reflecting all of the functions &lt;EM&gt;and&lt;/EM&gt; methods in the hierarchy.&amp;nbsp; I hope you can get to a resolution soon.&lt;P&gt;Take care,&lt;BR&gt;Bill</description><pubDate>Thu, 20 Dec 2007 17:25:32 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost13118.aspx</link><description>Business objects have a Count property on them already which does exactly what you describe.&amp;nbsp; My fill functions actually just return Me.Count.&lt;/P&gt;&lt;P&gt;The reason I like having them as functions returning a count is so I can do something like this:&lt;/P&gt;&lt;P&gt;If BO.FillAll() &amp;gt; 0 Then&lt;BR&gt;&amp;nbsp; 'Loop through the BO and do some processing&lt;BR&gt;End If&lt;/P&gt;&lt;P&gt;Otherwise it would be:&lt;BR&gt;BO.FillAll&lt;BR&gt;If BO.Count &amp;gt; 0 Then&lt;BR&gt;&amp;nbsp; 'Loop through the BO and do some processing&lt;BR&gt;End If&lt;/P&gt;&lt;P&gt;Granted, this isn't that much of a difference code wise.&amp;nbsp; However, I've already replaced probably 100 or more of the second type of call with something like the first, and changed the corresponding sub to a function returning the count.&amp;nbsp; It just makes for easier coding on my part if I do it the first way.&amp;nbsp; I basically don't want to waste a day reversing what I did when it should just be fixed in the framework to allow function on PopulationDataSourceSettings.</description><pubDate>Thu, 20 Dec 2007 17:00:12 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost13116.aspx</link><description>I ran this through my test app, and it seems to work.&amp;nbsp; My assumption is that you want the full count regardless of any subsequent browse dialog results.&amp;nbsp; This should work...as long as the FillAll() method is run initially.&amp;nbsp; You may want to consider setting the entire TotalCount property up without the need for the FillAll() method.&amp;nbsp; In other words keep them separate (although, there is some overlapping code there).</description><pubDate>Thu, 20 Dec 2007 16:27:33 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost13113.aspx</link><description>Have you considered using a property to reflect your count?&amp;nbsp; I am a bit rusty on VB (sorry), so here is a C# snippet:&lt;/P&gt;&lt;P&gt;private int mCount = 0;&lt;/P&gt;&lt;P&gt;public int CurrentCount&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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; return mCount;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;/P&gt;&lt;P&gt;public void FillAll()&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.FillDataTable("SELECT * FROM MyTable");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mCount = this.Count;&lt;BR&gt;}&lt;/P&gt;&lt;P&gt;For the count, just grab what's in the CurrentCount property of the BO.&amp;nbsp; Would that work?&lt;BR&gt;&lt;BR&gt;Bill</description><pubDate>Thu, 20 Dec 2007 15:54:13 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost13108.aspx</link><description>Has this been looked at or fixed yet?&amp;nbsp; Please let me know something.&amp;nbsp; I have lots of Fill&amp;nbsp;methods which I changed to functions&amp;nbsp;in my code which return back a count.&amp;nbsp; This is&amp;nbsp;starting to cause a lot of random errors in my code since I may have previously used that method to fill a combo, and changing to a function basically has broken a lot of my populated combos...giving me run-time errors when it's most inconvenient of course.&lt;/P&gt;&lt;P&gt;Also, any idea when we might have a new release?</description><pubDate>Thu, 20 Dec 2007 15:20:33 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost11533.aspx</link><description>We will add it to the list to take a look at.&amp;nbsp; Thanks. :)</description><pubDate>Tue, 18 Sep 2007 10:31:35 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost11518.aspx</link><description>Any update on this?&amp;nbsp; It's becoming a little more of a problem.&amp;nbsp; I have several FillAll Functions in my code which are used in the code to fill and retrieve a count, but used elsewhere to populate a combo.&amp;nbsp; I can't use the same function in both places right now, since I have to use a Sub instead of a Function for filling combos.&amp;nbsp;</description><pubDate>Mon, 17 Sep 2007 14:54:16 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost10951.aspx</link><description>10-4 thanks :)</description><pubDate>Mon, 20 Aug 2007 16:09:34 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost10949.aspx</link><description>Yeah, after Andria's post I figured something was going on there.&amp;nbsp; I will look into it.&amp;nbsp; Thanks.</description><pubDate>Mon, 20 Aug 2007 15:28:42 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost10944.aspx</link><description>Trent,&lt;/P&gt;&lt;P&gt;I ran across the same thing recently. The Method to execute dropdown does not show functions only methods.&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/8c2514e8-091b-41ac-8770-ddac.png"&gt;</description><pubDate>Mon, 20 Aug 2007 09:44:55 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost10939.aspx</link><description>Ok, I get what you are saying.&amp;nbsp; However, I have a return value explicitly set.&amp;nbsp; My code looks like the following:&lt;/P&gt;&lt;P&gt;Public Function FillAll() as Long&lt;BR&gt;&amp;nbsp; BO.FillDataTable("SELECT * FROM MyTable")&lt;BR&gt;&amp;nbsp; Return BO.Count&lt;BR&gt;End Function&lt;/P&gt;&lt;P&gt;Please let me know what I'm missing here.&amp;nbsp; I'm&amp;nbsp;a little confused after all the back and forth.</description><pubDate>Fri, 17 Aug 2007 22:49:01 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost10938.aspx</link><description>[quote]functions are required to have return values[/quote]&lt;/P&gt;&lt;P&gt;In C# that is true 100% of the time.&amp;nbsp; It sounds like you have your project setup correctly, but it is actually possible to omit this in VB....and then problems will occur.&amp;nbsp; The other thing that you can do in VB.NET, which is frustrating, is omit a return statement since by default is has a reference value to itself for backward compatability....wish you could force BOTH of these things to a compiler error no matter what!</description><pubDate>Fri, 17 Aug 2007 20:19:56 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost10932.aspx</link><description>Well, it did have a return value as a Function...functions are required to have return values, but in this instance I don't always need to use the return value.&amp;nbsp; I do have it working as a Sub, but I would really like to be able to use Functions in here as well.&amp;nbsp; I may have a FillAll that I would like to sometimes use and get back the count which I want to use in a dropdown.&amp;nbsp; I can't&amp;nbsp;use it&amp;nbsp;there as it is right now.</description><pubDate>Fri, 17 Aug 2007 16:26:41 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost10931.aspx</link><description>When it was a Function did it have a return value?&amp;nbsp; If not that could have prevented it from appearing.&amp;nbsp; At any rate, glad you got it working! :)</description><pubDate>Fri, 17 Aug 2007 16:08:09 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost10928.aspx</link><description>I don't use the GAC for my assemblies, so I don't think that's the issue.&amp;nbsp; The function was definitely Public, not Private.&amp;nbsp; That was the first thing I checked.&amp;nbsp; I built, rebuilt, closed VS and opened it back about 3 or 4 times just to be sure I wasn't crazy.&amp;nbsp; It never showed up in the dropdown.&amp;nbsp; Then I just changed it from a Function to a Sub, built my BO&amp;nbsp;library,&amp;nbsp;and presto, it showed up in the dropdown.</description><pubDate>Fri, 17 Aug 2007 15:04:46 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Cant use a Function to populate a combo box</title><link>http://forum.strataframe.net/FindPost10926.aspx</link><description>The only reason it would not show up is if it is a private method or if you store the assembly in which it resides in the GAC.&amp;nbsp; In the case of it being in the GAC, close down Visual Studio and come back in and it should then be available...AFTER you have sucessfully built the project in which the BO resides.</description><pubDate>Fri, 17 Aug 2007 14:58:48 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>