StrataFrame Forum

Adding Items to ComboBox

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

By Tim Dol - 8/24/2007

I need to add some functionality similar to the new user-defined category that you added to the DDT. I also believe the same functionality exists in the permissions editor.  I added a new field to my table to store the category value.

What technique did you guys use to populate the category combobox with unique category values and drop the cateogry when it was no longer in use. Did you create another table to maintain these values? 

Thanks

TIm

By StrataFrame Team - 8/24/2007

Actually, when we allow the user to manually type the category, we just fill the combo box by using

SELECT DISTINCT category FROM MyTable ORDER BY category

which just retrieves all of the values.  When all of the records using the category are removed or moved to another category, it just no longer appears in the list because it's no longer in the table and therefore doesn't get picked up by the query.

By Tim Dol - 8/24/2007

Will this be slow on large tables?
By StrataFrame Team - 8/27/2007

We haven't had it slow down perceptively.  If it ever does, you could certainly cache off the values in a Shared business object somewhere.  I'm sure you might be able to find something on Google about the performance of a SELECT DISTINCT.
By Greg McGuffey - 8/27/2007

I think the key would be to have an index on the category (or whatever column your doing the select distinct on). Otherwise, there will be temp tables and table scans and it gets ugly fast.