Behavior stack script not run first time card is visited
Posted: Tue Oct 03, 2017 7:47 pm
I have some buttons on a card. The behavior of all the buttons is set to the same script-only stack and works as expected in the IDE.
For my Android standalone however, the first time I visit the card and click on any of the buttons nothing happens. If I go to another card then back to the card with buttons, all the buttons then trigger the event handler in my script-only stack as I would have expected the first time.
Before the first visit I've checked (by answer dialogs when running):
- the behavior stack is included in the stackFiles of the UI stack
- the behavior of the buttons is set to the stack
- the behavior stack exists and is loaded in memory
Just to make sure there was nothing wrong in the way I was pressing the buttons, for one of them I over-ruled the shared behavior with the script file directly attached to the button in the IDE. This confirmed the button press was being correctly registered.
For information, the card containing the buttons also gets its behavior from a script-only stack but I’m using this kind of setup on another card where the buttons respond as expected on first visit. Also I’m using Levure though I can’t think why that would make any difference.
It may be difficult to try & reproduce in a simplified app.
Anyone any ideas what could be going wrong & / or how to diagnose?
Thanks for reading,
Jim
For my Android standalone however, the first time I visit the card and click on any of the buttons nothing happens. If I go to another card then back to the card with buttons, all the buttons then trigger the event handler in my script-only stack as I would have expected the first time.
Before the first visit I've checked (by answer dialogs when running):
- the behavior stack is included in the stackFiles of the UI stack
- the behavior of the buttons is set to the stack
- the behavior stack exists and is loaded in memory
Just to make sure there was nothing wrong in the way I was pressing the buttons, for one of them I over-ruled the shared behavior with the script file directly attached to the button in the IDE. This confirmed the button press was being correctly registered.
For information, the card containing the buttons also gets its behavior from a script-only stack but I’m using this kind of setup on another card where the buttons respond as expected on first visit. Also I’m using Levure though I can’t think why that would make any difference.
It may be difficult to try & reproduce in a simplified app.
Anyone any ideas what could be going wrong & / or how to diagnose?
Thanks for reading,
Jim