Options

Close page after runmodal

poppinspoppins Member Posts: 647
Hi everyone,

I am running page2 from page1 with a runmodal instruction.
I want page 1 to close after page 1 is opened.
I tried the following code:

page2.RUNMODAL;
CurrPage.CLOSE();

but it didn't work like I want: page1 stays opened until I close page2, then it closes...
Is there a way to achieve what I described?

Thanks in advance :smile:

Comments

  • Options
    belindasphotobelindasphoto Member Posts: 4
    But why do you want to run the page then close it? Can't you write a function in the page object and call the function only?
  • Options
    Jan_VeenendaalJan_Veenendaal Member Posts: 206
    RUNMODAL starts Page2 in this case, and code in page 1 will not continue until page 2 is closed again (that is how RUNMODAL works) - so the CurrPage.CLOSE happens right after Page 2 has been closed (by the user) - not earlier.

    The main reason to use RUNMODAL is that you would need the results of Page2 to use them in Page1 - but since you want to close Page1 I guess you should use RUN instead of RUNMODAL
    Jan Veenendaal
Sign In or Register to comment.