Cant use a Function to populate a combo box
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


««12

Cant use a Function to populate a combo boxExpand / Collapse
Author
Message
Posted 09/17/2007 2:54:16 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 06/12/2008 10:28:41 AM
Posts: 303, Visits: 434
Any update on this?  It's becoming a little more of a problem.  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.  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. 
Post #11518
Posted 09/18/2007 10:31:35 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 9:47:36 PM
Posts: 4,115, Visits: 4,185
We will add it to the list to take a look at.  Thanks.
Post #11533
Posted 12/20/2007 3:20:33 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 06/12/2008 10:28:41 AM
Posts: 303, Visits: 434
Has this been looked at or fixed yet?  Please let me know something.  I have lots of Fill methods which I changed to functions in my code which return back a count.  This is 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.

Also, any idea when we might have a new release?

Post #13108
Posted 12/20/2007 3:54:13 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/03/2008 6:32:47 PM
Posts: 349, Visits: 1,205
Have you considered using a property to reflect your count?  I am a bit rusty on VB (sorry), so here is a C# snippet:

private int mCount = 0;

public int CurrentCount
{
    get
        {
            return mCount;
        }
}

public void FillAll()
{
    this.FillDataTable("SELECT * FROM MyTable");
    mCount = this.Count;
}

For the count, just grab what's in the CurrentCount property of the BO.  Would that work?

Bill

Post #13113
Posted 12/20/2007 4:27:33 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/03/2008 6:32:47 PM
Posts: 349, Visits: 1,205
I ran this through my test app, and it seems to work.  My assumption is that you want the full count regardless of any subsequent browse dialog results.  This should work...as long as the FillAll() method is run initially.  You may want to consider setting the entire TotalCount property up without the need for the FillAll() method.  In other words keep them separate (although, there is some overlapping code there).
Post #13116
Posted 12/20/2007 5:00:12 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 06/12/2008 10:28:41 AM
Posts: 303, Visits: 434
Business objects have a Count property on them already which does exactly what you describe.  My fill functions actually just return Me.Count.

The reason I like having them as functions returning a count is so I can do something like this:

If BO.FillAll() > 0 Then
  'Loop through the BO and do some processing
End If

Otherwise it would be:
BO.FillAll
If BO.Count > 0 Then
  'Loop through the BO and do some processing
End If

Granted, this isn't that much of a difference code wise.  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.  It just makes for easier coding on my part if I do it the first way.  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.

Post #13118
Posted 12/20/2007 5:25:32 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/03/2008 6:32:47 PM
Posts: 349, Visits: 1,205
Seems like a simple enough correction within the framework; however, that may get a bit messy reflecting all of the functions and methods in the hierarchy.  I hope you can get to a resolution soon.

Take care,
Bill

Post #13120
Posted 12/21/2007 9:19:07 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 9:47:36 PM
Posts: 4,115, Visits: 4,185
Also, any idea when we might have a new release?

We have already decided that we will reflect the functions as well in the next update.  As for an exact date on the new release, I cannot give you one.  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.  So it will probably be January sometime that we publish the new update.

Post #13129
Posted 12/21/2007 1:16:28 PM