Thursday, March 26, 2015

Strange behavior with locked/disabled fields when using restart window

I have a button that I click that disables other fields, processes something, and then enables the other fields again. This is legacy code, and for some reason it's restarting the window in the middle of processing. The strange behavior is that if i click on a field when it appears to be disabled, the field change script STILL RUNS!

From this, I can infer how GP processes commands. It must use a stack, and pushes down commands on the stack, and then processes them in order that they are popped. Restarting a window must be re-enabling fields without appearing like it's doing that, which is why it takes the button click event and pushes it on the stack.

For example:
1. Click processing button - disable back button and click it.
2. In the middle of processing restart the window
3. Renable the back button

The stack looks like this:
win pre script
back button click

because the back button click happened first, it gets pushed on the stack.

No comments:

Post a Comment

There was an error in this gadget