I've been working to understand the code in the CGDevTools IW XIV V2 Demo and to that end I've created a program to test dynamically creating frames that is based on the demo code. I am however, experiencing some strange behavior in the dynamically created frames. For instance, the first time the frame is created (from the form's OnCreate event) it works normally, but when it is re-created (after another frame has been created and destroyed) I no longer have access to the values in the edit fields. Even stranger, when creating the frame again (after another being created and on odd numbered attempts) I have access to the values again.
To recreate the behavior, perform the following steps:
- Execute the program and open in browser.
- Enter AAAAAA into the input field and press tab - you will see AAAAAA be displayed in the label underneath. CORRECT BEHAVIOR (1)
- Click the Create Frame 2 button.
- Enter AAAAAA into the input field and press tab - you will see BLANKS be displayed in the label underneath. INCORRECT BEHAVIOR (2)
- Click the Create Frame 1 button.
- Enter AAAAAA into the input field and press tab - you will see AAAAAA be displayed in the label underneath. CORRECT BEHAVIOR (3)
- Click the Create Frame 2 button.
- Enter AAAAAA into the input field and press tab - you will see BLANKS be displayed in the label underneath. INCORRECT BEHAVIOR (4)
- Click the Create Frame 3 button.
- Enter AAAAAA into the input field and press tab - you will see BLANKS be displayed in the label underneath. INCORRECT BEHAVIOR (5)
- Click the Create Frame 1 button.
- Enter AAAAAA into the input field and press tab - you will see BLANKS be displayed in the label underneath. INCORRECT BEHAVIOR (6)
- Click the Create Frame 2 button.
- Enter AAAAAA into the input field and press tab - you will see BLANKS be displayed in the label underneath. INCORRECT BEHAVIOR (7)
- Click the Create Frame 3 button.
- Enter AAAAAA into the input field and press tab - you will see BLANKS be displayed in the label underneath. INCORRECT BEHAVIOR (8)
- Click the Create Frame 1 button.
- Enter AAAAAA into the input field and press tab - you will see AAAAAA be displayed in the label underneath. CORRECT BEHAVIOR (9)
Notice that the values are never accessible from Frame 2 & 3 and only available on Frame 1 when it has been created an odd number of times.
Can someone look at the example I've uploaded and tell me where I've messed up? This is driving me bananas...
Thanks for any help you can provide in understanding my error,
John