Connecting the wires
We now have two completely functional windows in our application. But we need to create some sort of navigation bridge in order for our users to navigate from one window to the next. While we are at it, we will give users the ability to manually refresh the list as their geographic location might change while using the application.
Selecting a photo
The very first thing we will do is to load the PhotoViewerWindow
module from our main window. To do this, we will add the following line at the very top of the ApplicationWindow.js
file:
var PhotoViewerWindow = require('PhotoViewerWindow');
To open the photo viewer window when the user selects a photo from the list; we will add an event handler to our ListView object. When the itemclick
event is triggered, we will create a new instance of the PhotoViewerWindow
class by passing it the itemId
event from the selected row. We will then open our newly created window:
listView.addEventListener('itemclick', function(e){ var photoWin...