Global vars needed for modals I create?
Posted: Sun Apr 08, 2018 5:39 pm
In the past I've called the "ask" dialog to request info from the user and, if the "OK" button was pressed, the requested info was now in "it". No problems.
Now, however, I am requesting the user provide much more detailed information that needs to remain structured so I've created a substack with fields, called it with "as sheet", then populated those fields in the substack with certain info from the main stack.
Before I get too far down this rabbit-hole, I wanted to post my process for this for comment by those more experienced in these matters.
What I've found is that I need to pass the information by splitting the process between the button that fills a global variable with the info from the main stack and then calls the modal, followed by an Open Stack handler in the sub-(modal)-stack that fills in the fields using the data that I placed into the global var.
Coming back from the modal (assuming the user clicked the button approving the change or addition), I have to fill the global again (with the data from the fields in the modal) and close the modal; then I'm back in the original button's script that called the modal in the first place where I finish processing the data the user approved in the modal.
I am assuming this "division of work" is necessary because calling the sub-stack as a modal prevents any further processing of the calling handler until the modal is dismissed. Additionally, I need to use globals because I am moving from one handler to another then back again. Am I understanding this correctly?
Thanks for your comments.
Barry
Now, however, I am requesting the user provide much more detailed information that needs to remain structured so I've created a substack with fields, called it with "as sheet", then populated those fields in the substack with certain info from the main stack.
Before I get too far down this rabbit-hole, I wanted to post my process for this for comment by those more experienced in these matters.
What I've found is that I need to pass the information by splitting the process between the button that fills a global variable with the info from the main stack and then calls the modal, followed by an Open Stack handler in the sub-(modal)-stack that fills in the fields using the data that I placed into the global var.
Coming back from the modal (assuming the user clicked the button approving the change or addition), I have to fill the global again (with the data from the fields in the modal) and close the modal; then I'm back in the original button's script that called the modal in the first place where I finish processing the data the user approved in the modal.
I am assuming this "division of work" is necessary because calling the sub-stack as a modal prevents any further processing of the calling handler until the modal is dismissed. Additionally, I need to use globals because I am moving from one handler to another then back again. Am I understanding this correctly?
Thanks for your comments.
Barry