I have the following scenario in which swapWindow() is not acting as I expect it to:
My project contains an overview screen showing individual devices. The user can click on a device to open an information screen. All devices open the same information screen that is configured for the specific device through a passed parameter used in the internalFrameActivated script. The following script opens the information screen:
system.nav.openWindow('Tubular_Press_Info', {'press_number' : event.source.parent.Press_ID})
system.nav.centerWindow('Tubular_Press_Info')
This works fine and as I expect.
Within the information screen, I am adding navigation buttons to allow the user to switch between devices using the following event script:
[code]import app.pressnav.nav.nextPress
currentWindow = system.gui.getParentWindow(event).name
system.nav.swapWindow(currentWindow, ‘Clincher_Press_Info’,
{‘press_number’ : app.pressnav.nav.nextPress(event.source.parent.press_number)})[/code]
The idea is to avoid having to close the information screen and then reopening it by clicking on a different device. My problem is that when navigating “back” to the window in this way, the internalFrameActivated script does not get fired and the window isn’t configured for the new press_number.
My questions:
- Is this a bug or expected/featured behavior?
- Is there an easy way to fire the internalFrameActivated event within my code? Something like:
[code]import app.pressnav.nav.nextPress
currentWindow = system.gui.getParentWindow(event).name
system.nav.swapWindow(currentWindow, ‘Clincher_Press_Info’,
{‘press_number’ : app.pressnav.nav.nextPress(event.source.parent.press_number)})
Fire internalFrameActivated event
[/code]
Thanks.