Combobox filled from database

Jim Bufalini jim at visitrieve.com
Sun May 10 21:49:40 EDT 2009


Hi Joseph

> I need any help about how to set up some combobox that is filled from a
> database. The question is how to show value A but link to the database
> by
> the value B. I fill the combobox with:
> 
> <value a> <tab> <tab> <tab> <value B>
> 
> Many tabs to hide from the visible area.
> 
> But when select the value from the database I don't see how to select
> the
> correct value. Maybe is a stupid question but I don't see how to do...

I think you may be trying to use a combo box for a purpose for which it is
not intended. ;-)

Since I know you have ListMagic, maybe a quick and easy way to do what you
need is set up a ListMagic widget into which you populate with two columns
in the form of 

<value a> tab <value b> cr <value a2> tab <value b2>

but make only the first column of the widget visible. I assume there will be
more than one <value a> from which the person selects (otherwise why a combo
box?).

So when the person selects from the visible list of column a, you grab
column b (which is invisible to the user but available to your code) of the
returned line they selected. Then process any way you wish.

Let me know if this is what you are trying to do.

Aloha from Hawaii,

Jim Bufalini




More information about the use-livecode mailing list