When is suspendStack sent?

Bob Sneidar bobsneidar at iotecdigital.com
Thu Sep 20 13:05:43 EDT 2018


I'm still curious why suspendStack is not getting sent to what appears for all intents and purposes to be the topStack (I even click the titlebar to make sure), but I found a workaround which is a bit more elegant. If I have a substack open, say for editing the details of a site record, and I am in editing mode, I check for that back on the main stack (which displays summary information for all the primary modules) and I prevent a new datagrid selection on the main form if so. 

Not sure if this helps anyone, but the second parameter in SelectionChanged (the old selection) really comes in handy here because I need to re-select the old selection. It's probably an edge case for me because I sync main stack selections with substack selections and vis versa, so the user doesn't think he's viewing or editing one record when he thinks he's editing another. Changing records in the middle of an edit therefore can corrupt data, overwriting one record with the contents of another while saving. 

Bob S


> On Sep 20, 2018, at 09:02 , Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi all. 
> 
> I was using modal as a means to prevent a user from switching to another open window while in certain modes (editing a "form" for example). That is fraught with peril for a number of reasons I will not go into here. 
> 
> So alternatively I thought to put a suspendStack handler in the stack script, then check for the condition and pop a dialog alerting the user, then issuing a go stack <whatever> to refocus on the stack. 
> 
> The first time it works great. The second and subsequent times however, suspendStack is NOT getting sent! Why? Is it because the original stack is no longer the topStack? 
> 
> Bob S





More information about the use-livecode mailing list