Click to See Complete Forum and Search --> : How to populate combo box with values of a table column?


zxmgh
07-18-2002, 04:58 PM
Hi, I am working on create a combo box which show the list of values of a table column, do you know where to put the select query to populate the combo box?

I know combo box is memoryless, how can I make the new value also appears in the list?

Thanks

stecal
07-18-2002, 05:06 PM
You can do a query to get the range of values and then do something like this:

-- Set position values
port_stposn := :model.model_port_st_posn;
port_cap := :model.model_port_capacity;
maxposn := port_cap + port_stposn - 1;

-- Fill LOV with open positions
item_id := Find_Item('ADD_BLOCK.ADD_POSITION');
if NOT ID_Null(item_id) then
CLEAR_LIST(item_id);
-- Create list of all valid positions
for i IN port_stposn..maxposn LOOP
ADD_LIST_ELEMENT(item_id,list_index,to_char(i),to_char(i));
list_index := list_index + 1;
end loop;