Chapter Contents

Previous

Next
List Box: _repopulate

List Box: _repopulate



Refills a list box with the current values of the source that populates the list box


Syntax
Details
Example

Syntax

CALL NOTIFY (list-box-name, '_repopulate');


Details

The list box is refilled based on the value of Fill type in the List Box Attributes window.

The _update method for list boxes works the same as the _repopulate method if the list boxes are not in an extended table. If a list box is in an extended table, the _update method works the same as the _refresh method.

Note:    The _repopulate method performs some processing that must take place before a list box is repopulated. Therefore, if you write your own method to customize the processing, you must call the _repopulate method of the parent class as the first command in the method you write. Use the CALL SUPER routine to call the _repopulate method of the parent class:   [cautionend]

POPULATE:
   method;
      call super(_self_,'_repopulate_');
      /* SCL code to repopulate list box */
   endmethod;

For more information on writing your own methods and on the CALL SUPER routine, refer to SAS\/AF Software: FRAME Application Development Concepts.


Example

This example shows how the _repopulate method uses the current values of the source to fill the list box. Assume that the Attributes Window specifies that LISTBOX1 is initially filled with an SCL array named ALPHA.

   /* Create the array that fills the 
      list box */
array alpha $ ('a' 'b' 'c');

   /* Create a second array with the same
      values */
array base  $ ('a' 'b' 'c');

   /* Each time the list box is selected, 
      increment the counter   */
   /* and append the counter value to the 
      base values.            */
   /* Copy the new value into ALPHA. 
                                   */
main:
  counter+1;
  do i = 1 to dim(alpha);
    alpha(i) = base(i) || compress(put(counter,
                                   2.));
  end;

      /* Refill LISTBOX1 with the current 
         values of ALPHA */
  call notify('listbox1', '_repopulate_');
return;

When the window opens, the values in the list box are a, b, c. After the user clicks on an item once, the MAIN section runs, the SCL array ALPHA is updated, and the list box is repopulated with the new values of ALPHA: a1, b1, c1. old example _repopulate refills LISTBOX1.

   call notify('listbox1','_repopulate_');


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.