Event from List RP
Event from List RP
I have a Form RP which contains a PRIM_LIST. In the PRIM_LIST one of the columns is a Prim_list.IListCellDesign RP. In the Cell I want to signal an event back back to the form but I don't know how to define the event in the Form RP as it would be coming from the PRIM_LIST but is not listed as an event on this object. Is this doable?
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: Event from List RP
You can only handle an event on an object to which you have a reference.
So, for list processing, the simple solution to this is to grab a reference to the object when focus changes
Add a define_Com for the class of the reusable part and set it when ever the list focus changes. You'll then have a reference to listen to events on.
So, for list processing, the simple solution to this is to grab a reference to the object when focus changes
Add a define_Com for the class of the reusable part and set it when ever the list focus changes. You'll then have a reference to listen to events on.
Code: Select all
Define_Com Class(#MyReusablePart) Name(#CurrentPart) Reference(*Dynamic)
Evtroutine #List.ItemGotFocus
#CurrentPart <= #PartColumn.Currentitem.Part *as #MyReusablePart
Endroutine
Evtroutine #CurrentPart.Something
Endroutine
Re: Event from List RP
Thank you. That worked and filled another little gap in my understanding (don't worry plenty left).
Re: Event from List RP
wow. very cool. thanks!Stewart Marshall wrote:You can only handle an event on an object to which you have a reference.
So, for list processing, the simple solution to this is to grab a reference to the object when focus changes
Add a define_Com for the class of the reusable part and set it when ever the list focus changes. You'll then have a reference to listen to events on.
Code: Select all
Define_Com Class(#MyReusablePart) Name(#CurrentPart) Reference(*Dynamic) Evtroutine #List.ItemGotFocus #CurrentPart <= #PartColumn.Currentitem.Part *as #MyReusablePart Endroutine Evtroutine #CurrentPart.Something Endroutine
Art Tostaine