ReloadPicklist

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
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

ReloadPicklist

Post by atostaine »

On Ver 15, I right click the methods for a visual dynamic picklist that is a field visualization. I see a method reloadPicklist. But I can't define that in my reusable Part.

My problem is that I need to load a drop down list after another value is selected. For instance, I don't want to load a drop down of parts until they select a warehouse code. Is there another way to do it?
Art Tostaine
User avatar
Dino
Posts: 477
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: ReloadPicklist

Post by Dino »

Hi Art,

I was checking the forum for a related thing and notice this old post. did you make it work?
the way to trigger the visualization to reload is playing with the .ApplyMonitoredValue method.
I just did a quick test, creating a visualization reusable part like this for SECTION field based in the documentation here:
https://docs.lansa.com/15/en/lansa013/i ... 3_0460.htm

Code: Select all

Function Options(*Direct)
Begin_Com Role(*EXTENDS #PRIM_OBJT *implements #Prim_dc.iDynamicPicklist #Prim_dc.iMonitorSubject)

Mthroutine Name(Load) Options(*Redefine)
#Picklist.RemoveAll
Select Fields(*All) From_File(Sectab) With_Key(#Deptment)
#Picklist.Add( #Section #Secdesc )
Endselect
Endroutine

Mthroutine Name(ApplyMonitoredValue) Options(*Redefine)
#Deptment := #MonitorSubject.GetValue
Endroutine
End_Com
associated it to the SECTION field, visualization tab as a DynamicPicklist and create a test FORM like this, and for any change in the DEPTMENT field, it reloads the SECTIONs with the correct values:

Code: Select all

Function Options(*Direct)
Begin_Com Role(*EXTENDS #PRIM_FORM) ClientWidth(484) ClientHeight(301) ComponentVersion(2) Left(1007) Top(232)

Define_Com Class(#SECTION.VisualPicklist) Name(#SECTION) DisplayPosition(1) Left(32) Parent(#COM_OWNER) TabPosition(1) Top(96)
Define_Com Class(#DEPTMENT.Visual) Name(#DEPTMENT) DisplayPosition(2) Left(32) Parent(#COM_OWNER) TabPosition(2) Top(47)

Evtroutine Handling(#DEPTMENT.Changed) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
#SECTION.ApplyMonitoredValue MonitorSubject(#DEPTMENT)
Endroutine
End_Com
formvis.jpg
formvis.jpg (23.28 KiB) Viewed 15331 times
Last edited by Dino on Tue Nov 16, 2021 1:40 am, edited 2 times in total.
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: ReloadPicklist

Post by atostaine »

No I had to make my own picklist. This is great to know for the future though. Thanks.
Art Tostaine
Post Reply