Page 1 of 1

VLF-ONE Programming 101

Posted: Sat Jun 22, 2019 5:22 am
by Fromm603
So, I am using VL Frameworks (LANSA recommendation).
First I have an application and business object, then...
I have a Filter, Instance, and command handler. MY filter works fine (so my server module is working fine too), and produces an instance list of items (Including descriptions and other fields). So now if I want to add a command (so I want to display different data, say, sales data) based on the item the user clicked on. How does my new command handler (defined in the frameworks under commands allowed) get passed the item number that was clicked?
In my known RPG universe, it's a simple Parameter on the call, then *Entry on the program (command handler in LANSA parlance) that displays the data.
Seems simple enough. Thanks in advance for anyone's help.

Re: VLF-ONE Programming 101

Posted: Mon Jun 24, 2019 8:47 am
by MarkDale
When your filter writes data to the instance list it should specify some identifying keys (AKeys and NKeys).

For example, in shipped filter example DF_T41F1O, it writes an AKey1

Code: Select all

#avListManager.AddtoList Visualid2(#xEmployeeIdentification) Visualid1(#xEmployeeSurname + ' ' + #xEmployeeGivenNames) Akey1(#xEmployeeIdentification) Icolumn1(#uImageEmployee)
When the user clicks on a line on the instance list, the uExecute routine in the command handler runs. It can get the identifying keys of the instance list item in two ways.

A) It can use #AvListManager.GetCurrentInstance to get Akey1 into field #xEmployeeIdentification

Code: Select all

#avListManager.GetCurrentInstance Akey1(#xEmployeeIdentification)
B) It can get the object that holds all the instance list item data, using #AVLISTMANAGER.CurrentInstance

For example, See shipped example DF_T42H1O

Code: Select all

* The instance list item of the employee currently being viewed and edited
Define_Com Class(#vf_lm003O) Name(#DisplayedEmployeeDataItem) Reference(*DYNAMIC)
..
#DisplayedEmployeeDataItem <= #AVLISTMANAGER.CurrentInstance
...
#xEmployeeIdentification := #DisplayedEmployeeDataItem.avAKey1

Re: VLF-ONE Programming 101

Posted: Tue Jun 25, 2019 12:05 am
by Fromm603
Thank you very much !! :)