Kbase 20289: ADM. How to Pass Values Between Selection-List Widgets
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  3/12/2003 |
|
Status: Unverified
GOAL:
ADM1. Sample code that allows you to pass list items from one Selection-List widget to another.
FACT(s) (Environment):
Progress 8.X
FIX:
If you want to offer multiple columns of information, you might prefer using a browse widget.
It is a three-part solution that involves:
- Creating the window
- Populating the selection list
- Passing values between selection lists
Follow these steps to create the window:
1) Connect to the Sports database.
2) Create a non-smart window.
3) Place 2 Selection-List widgets and 2 button widgets on the window.
4) In the property section of the Selection-List widgets, select the sort and multiple-selection attributes.
From this point on the selects are referred to as select-1 and select-2. The buttons are named add and remove.
Populating the Selection-List:
The point of this solution is achieved here. First, populate the Selection-List. Second, assign the delimiters for the Selection-Lists.
Default for the delimiter is a comma (,) but the strings that are used to populate the Selection-List might be in the following strings. After the code to run enable_UI, place this statement in the main block:
ASSIGN select-1:DELIMITER = CHR(5)
select-2:DELIMITER = CHR(5).
This example uses CHR(5) to delimit this list with unprintable characters. The character you use is at your discretion.
After the above code, use the following to populate select-1:
FOR EACH salesrep:
SELECT-1:ADD-LAST(rep-name).
END.
Passing values between Selection-Lists:
In the choose trigger of the add button, apply the following code:
DO:
IF select-1:SCREEN-VALUE = ? THEN RETURN NO-APPLY.
ELSE
select-2:ADD-FIRST(select-1:SCREEN-VALUE).
select-1:DELETE(select-1:SCREEN-VALUE).
END.
This code adds the selected items to the second select and deletes them from the first. The code for the remove button is the same code with the selects' names reversed.
Progress Solution 13349, "Frequently Asked How-To Questions on the SELECTION LIST".
Progress Solution 15838, "How to Select All Items in a Multiple Selection-List".
Progress Solution 13638, "Last Item Selected in Multiple Select SELECTION LIST".
Progress Solution 16393, "How to Deselect Items from MULTIPLE SELECTION-LIST".