GUI ScreenIO for Windows

 ScreenIO.com


The listview-B event

A listview-B event is returned when the user selects a different item in the listview. 

Data returned with this event

Required to process this event

In panel-3 area Data
listview-SEL1-KEY The value of the invisible key column for the selected record.

Returned but not used to handle this event

In panel-3 area Data
listview-MAX Maximum number records that may be passed in the listview buffer, useful for PERFORMed loops when loading records to  your listview buffer.
listview-SCROLL-TO-KEY Set to HIGH-VALUES.
listview-TOP-OF-LIST-KEY The value of the invisible key column for the first (top) record that is visible in the listview control.
All other fields Set to LOW-VALUES.
In panel-4 area Data
listview Number of items in the list that are selected.

Usual response

Use the value in listview-SEL1-KEY to read the record and do whatever is appropriate for your application.

Sample code

     PERFORM WITH TEST AFTER
         UNTIL panel-EVENT-CLOSE-WINDOW
            OR panel-EVENT-CLOSE-AND-STOP

       CALL 'GS' USING panel-1
                       panel-2
                       panel-3
                       panel-4

       EVALUATE TRUE

-->      WHEN listview-B
-->        MOVE listview-SEL1-KEY TO record-KEY
-->        SET file-command-READ TO TRUE
-->        CALL file-I-O-routine USING file-commands
-->                                    data-record
-->        IF valid-file-status
-->          PERFORM display-record
-->        END-IF

           .
           .
           .

       END-EVALUATE

     END-PERFORM.


Remarks

You might use this to automatically update fields that display data from a selected record when the user selects a different record.

For example, you could display a picture of a catalog item in an image control on the panel, which is updated when the user selects a different item in the listview.

Related topics:


© 2000-2019 Norcom, all rights reserved 

TOC

Send feedback to Norcom