StrataFrame Forum

Manually pop combo and pass params

http://forum.strataframe.net/Topic9459.aspx

By Howard Rybko - 6/9/2007

Hi

I am new to this stuff and I used this post http://forum.strataframe.net/Topic2062-7-1.aspx?Highlight=fill+combobox to work out how to manually pop. a combobox. Took me more time than getting a whole app running!

Now I cant seem to find a way pass a param to the fill procedure.

Please help.

Thank you

Howard

By Greg McGuffey - 6/9/2007

There are two ways to pass parameters to the method selected in the ListPopulationSettings to fill the list via a BO.



The first is to simply pass the parameters to the Requery() method. I.e. if you have a fill method that takes two parameters: FillByAccountDate(accountID As Integer, txDate As Date), you would use a requery like this: Requery(theAccountID, theTxDate). This is generally fine if you are only calling the requery method from one place in code.



If you call it from more than one place (a frequent situation), you'd hand the ListPopulating event of the listbox/listview. The event arg has a property called Paramters, which is an array of objects. You load the parameters here. I.e.



Private Sub lstAny_ListPopulating(ByVal e As Microfour.StrataFrame.UI.ListPopulatingEventArgs) Handles lstAny.ListPopulating

e.Parameters(0).Value = theAccountID

e.Parameters(1).Value = theTxDate

End Sub




This gets called just before the list is populated and fills the parameters that are passed to the fill method.



I hope this helps.



NOTE: I just typed this in, so the code might not be 100%, but hopefully you get the idea.
By StrataFrame Team - 6/11/2007

Way to go Greg Smile  You're on top of things.
By Greg McGuffey - 6/11/2007

It's just exciting that I actually know the answer sometimes, what with the zillion questions I've asked! BigGrin
By StrataFrame Team - 6/12/2007

It's because you've asked those questions that you know the answers Smile  We don't expect you to know things clairvoiantly.