Page 1 of 1
Windows Prompter on Grid
Posted: Fri Aug 25, 2017 9:30 pm
by boh
Hi everyone,
I have a field with a prompter; I need to pass to it some information (File key) in order to make a correct selection.
Is there a general way to communicate or to pass information to a prompter?
I know that I can use prompterxxx events on fields, but these events are not present in Grid.
Thank you in advance
Re: Windows Prompter on Grid
Posted: Mon Aug 28, 2017 2:24 pm
by Stewart Marshall
The simplest technique I think is to add a property to the prompter form and then set the value in the PrompterActivate event
For example, my Prompter Form is called "MyPrompterForm" and I've defined a property as follows. When the value is set, the list is loaded
Code: Select all
Define_Pty Name(Key) Set(SetKey)
Ptyroutine Name(SetKey)
Define_Map For(*Input) Class(#Prim_Alph) Name(#Property)
Clr_List Named(#List)
Select Fields(....
Add_Entry To_List(#List)
Endselect
Endroutine
In the form where it's used, the processing would look like this
Code: Select all
Evtroutine Handling(#Grid.PrompterActivate) Form(#Prompter)
(#Prompter *As #MyPrompterForm).Key := #KeyField
Endroutine
The Form parameter of the event provides access to the instance of the prompter form. We can then cast this to the class required which gives access to the Key property.
Re: Windows Prompter on Grid
Posted: Mon Aug 28, 2017 6:10 pm
by boh
Thank you very much!
It solved our problem
Best regards