Montura Consulting   Research & Development
SAS/AF Combo Box
class combobox2 extends sashelp.classes.combobox_c.class;                      
public char dataName / (sendEvent='N', initialValue='any-sas-column-name');

public list gMessage / (sendEvent='N', autocreate='N');
public list gSelected / (sendEvent='N', autocreate='N');

_init: method / (state='o');
_super();
_addEventHandler(frameID, 'data status', 'runStatus');
endmethod;

_tabin: method / (state='o');
_super();

setnitemc(gSelected, dataName, 'help page');
frameid._sendEvent('present help');
endmethod;

_onReturnKey: method / (state='o');
_super();

call send(_self_, 'runPresent');
endmethod;

_onValueChanged: method / (state='o');
_super();

call send(_self_, 'runPresent');
endmethod;

_onClick: method / (state='o');
_super();

setnitemc(gSelected, dataName, 'help page');
frameid._sendEvent('present help');
endmethod;

_select: method / (state='o');
_super();

call send(_self_, 'runPresent');
endmethod;

runPresent: method;
if selectedIndex=0
then backgroundColor='Yellow';
else backgroundColor='White';

if backgroundColor='Yellow' then
insertc(gMessage, dataName||' is a required field', -1, 'warning');

if selectedIndex then
setnitemc(gSelected, selectedItem, dataName);

if listlen(gMessage) then
frameid._sendEvent('present message');

_refresh();
endmethod;
endclass;


 

COPYRIGHT © 1989 - 2012 Montura, Inc.
All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

Terms & Conditions -- Privacy Policy