Chapter Contents

Previous

Next
Data Set Data Model: _execCmd

Data Set Data Model: _execCmd



Processes a command


Syntax
Details
Example

Syntax

CALL SEND (object-id, '_execCmd');


Details

The _execCmd method is called on a model attached to a viewer only after the viewer tries to process the command. If the command is unrecognized by the viewer, it is sent to the model.

Use the _execCmd method when you want the model to process commands. Note that the command is not passed as an argument. Rather, it processes commands that are sent to the object. Commands are processed in the following order:

  1. If the command was issued while in a data form object or data table object, the viewer tries to process the command.

  2. If the viewer does not recognize the command, the command is sent to the data set data model object.

  3. If the data set data model object does not recognize the command, the command is sent to the data set model object.

  4. If the data set model object does not recognize the command, the command is returned to the frame.

Note:   If the _execCmd method receives a Data Set Model or a Data Set Data Model command, it commits any current row edits or a pending row to the data set and unlocks the currently locked row, if any.  [cautionend]


Example

The following example is an SCL program for a FRAME entry containing either a Data Form or Data Table object called VIEWER. This code allows the FORWARD or BACKWARD commands to scroll in VIEWER regardless of which object on the frame is active at the time the command is issued. All other commands are passed to the model using the _execCmd method.
 Note about code
INIT:
  control always;
  call send(_frame_,'_getWidget',
            'viewer',viewid);
  return;
 Note about code
MAIN:
  command=word(1,'u');
  select(command);
 Note about code
   when ('BACKWARD')
    call send(viewid,'_vscroll',
             'row',-1);
    call nextcmd();
 Note about code
   when ('FORWARD')
    call send(viewid,'_vscrolll','row',1);
    call nextcmd();
 Note about code
   otherwise
    if command ne _blank_ then
     call send(viewid,'_execCmd');
  end;
  return;


Chapter Contents

Previous

Next

Top of Page

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