Hello Peter,
Checking your code in this online tool, apparently there is no problem. So, I suspect that maybe a code like that (particularly the "onclick" event) can cause some problems... or... anyway... maybe it's required more information about, a possible sample app to reproduce the problem, for example.
However, I think there is a better approach: identify the button, place some information inside in a "data" attribute (optionally, I do it below because I like it), and then, use a jQuery event delegate in order to be ready for the button's click. Doing that, we no need to place any event in the button itself, which can cause undesired problems like you experience.
The below code is all what we need, and, can be placed in the app view Show event, in order to initialize the map, place a sample marker, and prepare the appropriate marker's info window, with a button inside, which go to another app view when it's pressed.
Below you have the complete sample app for AB1: save the XML into a "MyApp.ab" file, and open it with AB: