1
0
-1

 I am trying to get a very simple non-modal app working

app starts non-modal form X which retrieves and displays an overview list of persons  → OK

in a detail trigger I want to start a non-modal form Y with the details of the specific person

so I do a newinstance of form Y (with "MODALITY=NON-MODAL;TRANSACTION=TRUE")

followed by activate->ShowPerson(selectedPersonID)

if I use a local variable of type handle for the newinstance → Not OK, nothing showing

if I use a component variable of type handle or a general variable for the newinstance → OK

focus back on form X where I want to choose another person → OK

the first person detail form disappears/is replaced by the second ??? → Not OK

how to keep both detail forms open at same time and as seperate transactions ? I have no idea how many details will be opened so declaring multi component variables is not an option

putting the handles in a list does not work

Help ? any examples ?

    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

       I think that in order to get the form to show/stay, you NEED to activate the exec trigger. Which will, by default, put the form in 'edit' mode. You can make it display only by putting 'display' in the exec trigger. 

      I have no issues using local variables, but I always call the exec trigger. (You can call ShowPerson first, or afterwards). 


      Regards, 


      Iain

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Alex,

        Try using a local string variable rather than a handle and changing the call to ShowPerson an activate

        variables
           string vInstance
        endVariables
        
        newinstance "formY", vInstance
        
        activate vInstance.ShowPerson(selectedPersonID)


        Handles point to a single object instance and are reference counted. If a handle variable goes out of scope the object's reference count is reduced by one and if it has reached 0, the object instance will be deleted. This is what is happening with your local variable. Component variables will go out of scope then the component is exited and general/global variable when the application closes.


        Kind regards,

        Mike

          CommentAdd your comment...