New topic: Passing Parameters to Container Control
<http://forums.realsoftware.com/viewtopic.php?t=34279> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message JackieMiller Post subject: Passing Parameters to Container ControlPosted: Mon Jun 14, 2010 9:54 pm Joined: Thu Dec 17, 2009 3:49 pm Posts: 49 Let's say I have a container control called ccSQLQuery which has 6 fields and 2 are popup menus. In popup menu 1, I want a list of the fields of the table I can search on. In my test case, I have a table with 10 fields. In the IDE, I can hard code the 10 fields (or less) and then hard code the case statement to find out what field the user wants to search on. In keeping with the spirit of generic use, it would seem better to me to be able to pass in the fields, either by passing in the table name via a db.FieldSchema(TableName) call to the container control or maybe building my own array of field names and passing that in when the control is initialized. Any suggestions on best programming practice here? Top timhare Post subject: Re: Passing Parameters to Container ControlPosted: Tue Jun 15, 2010 12:08 am Joined: Fri Jan 06, 2006 3:21 pm Posts: 7889 Location: Portland, OR USA Add a method (2 actually, but they have the same name) PopulateFieldList. Make one version that accepts a RecordSet (that you obtain from FieldSchema) and one version that accepts a string array. All interaction between your code and the containercontrol should be via methods and events. Methods where your code wants to talk to the container, events where the container wants to talk to your code. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
