Timing of when field drop downs are loaded

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Mkolbe
Posts: 15
Joined: Tue Apr 04, 2017 12:45 am

Timing of when field drop downs are loaded

Post by Mkolbe » Thu Aug 22, 2019 12:26 am

I have a VIEW (#PRIM_VIEW) that displays a list of "Jobs". When the user selects one of the Jobs from the list, a DIALOG (#PRIM_DLG) appears, displaying data and allowing maintenance of the record chosen. The dialog contains multiple fields that are drop downs (dynamic picklists). I'm debugging the VIEW logic and before the ‘Get Entry” command occurs (result of Click event), reusable parts responsible for filling the dynamic pick lists for fields on the dialog are firing. This is causing me problems because for one of the drop downs, the logic needs a specific value from the selected row. Since the Get Entry has not yet occurred to obtain that value, my drop down on the dialog is empty.

What determines the timing of when drop downs associated with fields get loaded? Can I change this?
I tried setting the “DropDownLoading” parameter in the field visualization to “Deferred” but this doesn’t seem to accomplish anything.


VIEW LOGIC
Evtroutine Handling(#JobList.ItemClick)
#COM_OWNER.ShowCurrentItem
Endroutine

Mthroutine Name(ShowCurrentItem) Access(*PRIVATE)
Define_Com Class(#FS_DG_Job_Details) Name(#Details)
Get_Entry Number(#JobList.FocusItem.Entry) From_List(#JobList)
#App_State.gLocation := #FS13_LocationID
* Display the Dialog
#Details.ShowItem Cono(#FS13_Company) Id(#FS13_JobID)
Evtroutine Handling(#Details.ItemSaved #Details.BookSaved)
#COM_OWNER.Refresh
Endroutine

Endroutine

FIELD VISUALIZATION
Begin_Com Role(*Dynamic_Picklist #FS_RP_DropDown_Contact) Name(#DynamicPicklist) Nomatchaction(Blanks)

End_Com
Begin_Com Role(*Visual #PRIM_EVPL) Name(#VisualPicklist) Appearance(DropDownList) Height(21) Componentversion(1) Width(390) Marginleft(120) Defaultvisual(True) Dropdownloading(Deferred) Caption('Contact') Labeltype(Caption)

End_Com

Mkolbe
Posts: 15
Joined: Tue Apr 04, 2017 12:45 am

Re: Timing of when field drop downs are loaded

Post by Mkolbe » Thu Sep 12, 2019 11:46 pm

I figured out the answer. Drop Downs for fields on a dialog box are loaded when the Method routine containing the call to the Dialog box is initiated.
In my case, simply moving the "Get_Entry" into the ItemClick Event routine, allowed me to get the value I needed, then when the ShowCurrentItem method routine was called (which fires the Dialog field dropdown loading), I had the value which would be used in the Reusable part associated with the Dialog Field dropdown.

Evtroutine Handling(#JobList.ItemClick)
Get_Entry Number(#JobList.FocusItem.Entry) From_List(#JobList)
#App_State.gLocation := #FS13_LocationID

#COM_OWNER.ShowCurrentItem
Endroutine


Mthroutine Name(ShowCurrentItem) Access(*PRIVATE)
Define_Com Class(#FS_DG_Job_Details) Name(#Details)

* Display the Dialog
#Details.ShowItem Cono(#FS13_Company) Id(#FS13_JobID)
Evtroutine Handling(#Details.ItemSaved #Details.BookSaved)
#COM_OWNER.Refresh
Endroutine

Endroutine

Post Reply