Page 1 of 1
Set Main Stack Card from Modal
Posted: Thu May 07, 2020 8:28 pm
by velcrobelly
Is it possible to click on a button in a modal dialog that will then close the modal and change the card in the main stack?
Re: Set Main Stack Card from Modal
Posted: Thu May 07, 2020 8:34 pm
by dunbarx
I don't see why not. Have you tried it?
Certainly navigate to the card of interest before you close the stack. This means you must explicitly close the original stack, since you are no longer there.
You might want to lock the screen.
Craig
Re: Set Main Stack Card from Modal
Posted: Thu May 07, 2020 8:39 pm
by velcrobelly
I have tried:
Code: Select all
on mouseUp
go to card "card_acounts"
close this stack
end mouseUp
and it closes the modal, but does not go to the card.
Re: Set Main Stack Card from Modal
Posted: Thu May 07, 2020 9:01 pm
by Klaus
Hi velcrobelly,
there are several ways to do so.
I would probably do something like:
Code: Select all
on mouseup
send "go to cd card_accounts" to stack "the one with that namely card" in 1
close this stack
end mouseup
Best
Klaus
Re: Set Main Stack Card from Modal
Posted: Thu May 07, 2020 9:55 pm
by velcrobelly
Klaus, thank you for the response.
On the button in the modal I have placed:
Code: Select all
on mouseup
send "go to cd card_accounts" to stack "MainStack" in 1
close this stack
end mouseup
However, it only closes the modal and does not switch the card. BTW, I am using a substack as the modal.
I also noticed that if I comment out "close this stack" it does make the switch. So, is it closing before it can do the rest?
Re: Set Main Stack Card from Modal
Posted: Thu May 07, 2020 10:53 pm
by dunbarx
Hi.
If you go to the card of interest, you are on the stack of interest. If you then close "this stack", you will close, er, this stack, that is, the one that contains the card you are already on. This ignores the original stack.
I mentioned earlier that you should 1) go to the card of interest then 2) explicitly close the stack you navigated FROM.
If I understand at all what you are trying to do.
Craig
Re: Set Main Stack Card from Modal
Posted: Thu May 07, 2020 11:41 pm
by velcrobelly
Thanks, Dunbarx. The following appears to work:
Code: Select all
on mouseup
send "go to cd card_accounts" to stack "MainStack" in 1
send "close stack modal_dialog" to stack "MainStack" in 1
end mouseup
Re: Set Main Stack Card from Modal
Posted: Fri May 08, 2020 1:01 am
by dunbarx
Bingo!!!
And I bet you can see a little more clearly where you started from, where you ended up, and what you did along the way. All good stuff.
Craig