Sv: Returning value from window

Daniel Sananes daniel.s at kopparbergs.se
Wed Mar 22 07:45:13 UTC 2023


The logic could be that this line would set a reference to pListRef :
Set reference iList to pListRef.
A reference to the Field reference.

And this would set a reference to what pListRef references:
Set reference iList to pListRef.$ref.
A reference to the incoming list that is referenced by pListRef.

If that makes sense. Maybe.
So it is a chain of reference.
Incoming list -> Field reference -> Item reference.

So the .$ref would be:
Incoming list <- Field reference <- Item reference.

Without the .$ref the chain would only be:
Field reference <- Item reference.

Daniel

-----Ursprungligt meddelande-----
Från: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> För Rudolf Bargholz
Skickat: den 22 mars 2023 08:02
Till: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Ämne: AW: Returning value from window

Hi Daniel,

Sorry, not really. To be absolutely honest, if something does not work with references, I automatically try $ref at the end to see if it helps.

Regards

Rudolf

-----Ursprüngliche Nachricht-----
Von: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> Im Auftrag von Daniel Sananes
Gesendet: Dienstag, 21. März 2023 00:40
An: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Betreff: Sv: Returning value from window

Yes Rudolf.
That made it.
Strange reference.
Can you explain what the difference is with and without the .$ref.

Thanks
Daniel

-----Ursprungligt meddelande-----
Från: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> För Rudolf Bargholz
Skickat: den 20 mars 2023 20:27
Till: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Ämne: AW: Returning value from window

Hi Daniel,

You could try

Set reference iList to pListRef.$ref

Note the suffix $ref

Regards

Rudolf

-----Ursprüngliche Nachricht-----
Von: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> Im Auftrag von Daniel Sananes
Gesendet: Montag, 20. März 2023 16:35
An: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Betreff: Sv: Returning value from window

Hi Rudolf

The iList is an Item reference.
I am bewildered that it does not reflect back to original list.
The Field reference does so I set the line on that just before closing the window.

Daniel

-----Ursprungligt meddelande-----
Från: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> För Rudolf Bargholz
Skickat: den 20 mars 2023 15:48
Till: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Ämne: AW: Returning value from window

Hi Daniel,

your iList variable needs to be of type ItemReference, and not List. Perhaps this is your problem in the code below.

Regards

Rudolf Bargholz

-----Ursprüngliche Nachricht-----
Von: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> Im Auftrag von Daniel Sananes
Gesendet: Montag, 20. März 2023 12:04
An: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Betreff: Sv: Returning value from window

Thanks Scotte

Clicking on a line in the presented list that is an item reference to the parameterlist pRef does not reflect back to the original list.
It works if I assign the line to the Field reference just before the select window is closed.

Set reference iList to pListRef.
Enter data.
Do pListRef.$line.$assign(iLine) ## With this line it works. Without the pListRef stays as it were.
Do $cwind.$close().
Quit method.
---
Passing things back and forth.
Yes, what you say is how I do it in Omnis7.
Thought there could be other ways in Studio.
---

Regards
Daniel


-----Ursprungligt meddelande-----
Från: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> För Scotte Meredith
Skickat: den 20 mars 2023 00:51
Till: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Ämne: Re: Returning value from window

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
_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
VARNING: Det här e-postmeddelandet kommer från en extern avsändare. KLICKA INTE på länkar eller bilagor om du inte känner igen avsändaren och vet att innehållet är säkert.
_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
VARNING: Det här e-postmeddelandet kommer från en extern avsändare. KLICKA INTE på länkar eller bilagor om du inte känner igen avsändaren och vet att innehållet är säkert.
_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
VARNING: Det här e-postmeddelandet kommer från en extern avsändare. KLICKA INTE på länkar eller bilagor om du inte känner igen avsändaren och vet att innehållet är säkert.
_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
VARNING: Det här e-postmeddelandet kommer från en extern avsändare. KLICKA INTE på länkar eller bilagor om du inte känner igen avsändaren och vet att innehållet är säkert.


More information about the omnisdev-en mailing list