Page 1 of 1
ReloadPicklist
Posted: Thu Aug 12, 2021 12:32 am
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?
Re: ReloadPicklist
Posted: Thu Nov 11, 2021 2:30 am
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 (23.28 KiB) Viewed 15329 times
Re: ReloadPicklist
Posted: Thu Nov 11, 2021 2:34 am
by atostaine
No I had to make my own picklist. This is great to know for the future though. Thanks.