Address Form

Visual LANSA

Address Form

FUNCTION options(*DIRECT)

BEGIN_COM role(*EXTENDS #PRIM_FORM) CAPTION('Address Form') HEIGHT(211) LEFT(320) TOP(112) WIDTH(405)
DEFINE_COM class(#PRIM_STBR) name(#STBR_1) DISPLAYPOSITION(1) HEIGHT(24) LEFT(0) MESSAGEPOSITION(1) PARENT(#COM_OWNER) TABPOSITION(1) TABSTOP(False) TOP(160) WIDTH(397)
DEFINE_COM class(#EMPNO.Visual) name(#EMPNO) DISPLAYPOSITION(2) HEIGHT(18) LEFT(18) PARENT(#COM_OWNER) TABPOSITION(2) TOP(40) WIDTH(215)
DEFINE_COM class(#SURNAME.Visual) name(#SURNAME) DISPLAYPOSITION(3) HEIGHT(19) LEFT(16) PARENT(#COM_OWNER) TABPOSITION(3) TOP(20) WIDTH(324)
DEFINE_COM class(#PRIM_PHBN) name(#PHBN_1) CAPTION('Close') DISPLAYPOSITION(4) LEFT(304) PARENT(#COM_OWNER) TABPOSITION(4) TOP(128)
DEFINE_COM class(#ADDRESS1.Visual) name(#ADDRESS1) DISPLAYPOSITION(5) HEIGHT(19) LEFT(16) PARENT(#COM_OWNER) TABPOSITION(5) TOP(72) WIDTH(363)
DEFINE_COM class(#ADDRESS2.Visual) name(#ADDRESS2) DISPLAYPOSITION(6) HEIGHT(19) LEFT(16) PARENT(#COM_OWNER) TABPOSITION(6) TOP(88) WIDTH(363)
DEFINE_COM class(#ADDRESS3.Visual) name(#ADDRESS3) DISPLAYPOSITION(7) HEIGHT(19) LEFT(16) PARENT(#COM_OWNER) TABPOSITION(7) TOP(104) WIDTH(363)
 
* Define an event which will tell this form has closed
DEFINE_EVT name(u_Detail_form_closed)
 
* Published method which will get the #empno and #surname values from the main form, retreive the address information
* from the PSLMST file and then show this form
MTHROUTINE name(u_GetDetails)
DEFINE_MAP for(*INPUT) class(#EMPNO) name(#u_WithEMPNO)
DEFINE_MAP for(*INPUT) class(#SURNAME) name(#u_WithSURNAME)
CHANGE field(#EMPNO) to('#U_WITHEMPNO.VALUE')
CHANGE field(#SURNAME) to('#U_WITHSURNAME.VALUE')
 
IF cond('#EMPNO *NE *BLANKS')
FETCH fields(#ADDRESS1 #ADDRESS2 #ADDRESS3) from_file(PSLMST) with_key(#EMPNO)
ENDIF
INVOKE method(#COM_OWNER.ShowForm)
ENDROUTINE
 
EVTROUTINE handling(#PHBN_1.Click)
INVOKE method(#com_owner.closeform)
ENDROUTINE
 
EVTROUTINE handling(#COM_OWNER.Closing) options(*NOCLEARMESSAGES *NOCLEARERRORS)
* signal an event to the parent form telling that this form has closed
SIGNAL event(u_detail_form_closed)
ENDROUTINE
END_COM 

 

Ý Source Code for the Dynamic Reference Forms