I am trying to understand your architecture.

Somewhere you write about "pages", which makes it sound like you have one window with different contents.
But you seem to have at least two windows.

Cheers,
_