Returning value from window
Scotte Meredith
spomacguy at gmail.com
Sun Mar 19 23:51:15 UTC 2023
Yes, that is how you set it up. Any change to the line should be reflected in the original variable. Look at the variable itself rather than how it displays on the original window. Perhaps a redraw it needed on the first window.
As for how to pass other things back and forth, you can pass a reference of the original window to the new window and the name of the method you want to be called. Then you know the name to call back to pass no back.
Do $windows.vClientSelect.$open(‘*’,kWindowNormal,iClientList,$cinst.$ref,’$passbackDataMethod’)
In new window:
Set reference iirOrigWindow to pfrPassedInRef
Calculate icCallbackMethod as pcMethodName
Later in some other method:
Do iirOrigWindow.[icCallbackMethod](parameter1,parameter2)
Sent from my iPad
> On Mar 19, 2023, at 4:15 PM, Daniel Sananes <daniel.s at kopparbergs.se> wrote:
>
> Hi
>
> I have this line of code that opens a window for the user to select a client from the list.
> Do $windows.vClientSelect.$open('*',kWindowNormal,iClientList).
>
> In the ClientSelect window the receiving parameter pListRef is of type Field reference.
> The list is shown in the window with the instance variable iListRef which is of type item reference.
> The iListRef variable is set by Set reference iListRef to pListRef.
> Lines show up nice in the list and I click in the list on line 2.
> Now I think that the iClientList in the calling method should reflect that line 2 is now current.
> But it does not. No line is current.
>
> According to docs:
> "Once the field reference parameter variable is set up, a reference to the parameter is the same as using the field whose name is passed."
> This is not in my case true.
>
> Obviously I am doing something wrong.
>
> Another concern I have is how do you return a value from a window?
> I can do:
> Quit method VALUE
> But this is done after the window is closed so there is no VALUE.
> Unless I use global variables, but I don't think that is the way to go.
>
> /Daniel
> 0736 704070
>
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en
mailing list