Highlighted

Closing one modal window while opening another

Community Beginner ,
Jul 24, 2020

Copy link to clipboard

Copied

Hello everyone. Looks like a simple task, but an issue appears.

I need to close one modal window and open another. Here is the code:

 

var win1 = new Window ("dialog", "1");
var btn1 = win1.add("button", undefined, "Close 1");

var win2 = new Window ("dialog", "2");
var btn2 = win2.add("button", undefined, "Close 2");

btn1.onClick = function() {
    win1.close();
    win2.show();
}

btn2.onClick = function() {
    win2.close();
}

win1.show();

 

It's not working as I expect. First button doesn't close first window while second button does close both of them. Any ideas or advices?

Screenshot 2020-07-24 at 12.58.48.png

TOPICS
Scripting

Views

31

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Closing one modal window while opening another

Community Beginner ,
Jul 24, 2020

Copy link to clipboard

Copied

Hello everyone. Looks like a simple task, but an issue appears.

I need to close one modal window and open another. Here is the code:

 

var win1 = new Window ("dialog", "1");
var btn1 = win1.add("button", undefined, "Close 1");

var win2 = new Window ("dialog", "2");
var btn2 = win2.add("button", undefined, "Close 2");

btn1.onClick = function() {
    win1.close();
    win2.show();
}

btn2.onClick = function() {
    win2.close();
}

win1.show();

 

It's not working as I expect. First button doesn't close first window while second button does close both of them. Any ideas or advices?

Screenshot 2020-07-24 at 12.58.48.png

TOPICS
Scripting

Views

32

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 24, 2020 0

Have something to add?

Join the conversation
Resources