Go Back through a button command

I am trying to make the symbol from the built in folder allow me to go back to the previous page i had come from. I have gone into event handlers and chosen Forward/back and selected go back. i have chosen this command on the mouse - mouse clicked, as it does not seem to have an action performed tab. i have tried a different button that does have the action performed tab to go back but this alos will not go back a page for me, any assistancce would be greatfully received.

Ok, the forward and back actions happen only for main windows. A main window is a window that is set to start maximized in the client. You can only have one of these windows open at a time for the swap, forward and back to work properly.

Not all components have the actionPerformed so the mouse events are correct to use. However, I would suggest putting it on the mouseReleased or MousePressed so you don’t have to click twice once for focus on window and once for clicking the component.

I tried setting up a quick demo of this but can’t get it to work. I open Window 1 on startup as a floating maximised window. I have a button on Window 1 which swaps to Window 2 which works, but the button on Window 2 which tries to use the back function to return to Window 1 doesn’t.

What am I missing?

The forward/back functions only work when using the swapTo paradigm, instead of the swapWindow paradigm. I realize that this is a seemingly inconsequential difference, and forward/back should be made to work with swapWindow as well.

Hi hows it going, I appreciate your replies on the thread, I am not 100% clear on what you are saying. I have a large number of windows that i am working with within one project. I have a main page that directs me to a number of different windows. if when i go from the main page to another window, and the want to go back using the back button, does the main page have needed to be closed when opening the next window or is it just staying open behind the new window i have opened. this is confusing me. I feel that I have tried all the possible combinations available to me and I am still not able to achieve this function, is there a tutorial video i could watch maybe that has this demonstrated on it?

If all your windows are maximised and you are only displaying one window at a time,the best way to move to another window is to use the system.nav.swapTo function - look in the help under Project Design / Windows & Components / Windows / Swapping vs Opening.

If you swap from window A to window B, window A is closed and window B opened in its place (and with the same size). This is done with the following code:system.nav.swapTo("window B") A ‘back’ button on window B would actually swap back to window A using the following code:system.nav.swapTo("window A")I have always found it best to keep as ‘flat’ a menu structure as possible i.e. it should be possible to reach any window in the system within a couple of clicks. If you have to go through 4 or 5 layers to get to a window it can get confusing!

If this still isn’t clear, post more details on your windows and the links you want between them and we’ll try to work out a solution for you.

Hi I am still not sure if that is the process i require to perform the action i need. I basically want the “back” button to perform exactly the same way as it would on internet explorer so that if I open one screen, then move on to the next and then on to a third screen, i wish to be able to click on the back button to bring me back to the second page from the third and then back to the first page from the second. from my understanding of the code you have (very kindly might i add) advised me to use this will only bring me back to the previous page page by means that window A is the first page then, window B is the second page. but i presume that if i open up a third, it becomes window B and the original window B becomes window A.

You can go up and down as long a ‘chain’ of windows as you like with ‘swapTo’ - it only knows about the current window and the window you are going to. As Carl pointed out, if you use swapTo to open the windows, you could have a Back button on each window which would return you to the previously opened window.

Note that you cannot use the Swap option on the Navigation tab to implement this, as this defaults to using the swapWindow function. You will have to enter the code manually on the Script Editor tab.

Hi guys,

Sorry I am bringing you back to this topic again and I really appreciate all your comments, the only problem is that it hasn’t solved my problem re: Back Button. I have set up a trend graph and you can access this graph from many different windows and what i need it to do is go back to whichever window has brought you to it in the first place. i have the script that i am using behind these buttons below,

any replies would be greatfully appreciated


This script was generated automatically by the navigation

script builder. You may modify this script, but if you do,

you will not be able to use the navigation builder to update

this script without overwriting your changes.


selectedName = event.source.GraphName
#selectedID = ‘2’
selectedID = fpmi.db.runQuery(“SELECT ID as ID2 FROM ctg_saved_graphs where Description = ‘%s’” %selectedName)

cid = fpmi.system.getClientId()
selectedID2 = int(selectedID[0] [‘ID2’])
if selectedID2 != -1:

if fpmi.gui.confirm(“Do you want to open the Graph - ‘%s’” % selectedName):

points = fpmi.db.runQuery("SELECT PointID FROM ctg_saved_graph_pens WHERE SavedGraphID = %d" % selectedID2)

	# put data into active table used for viewing
for row in points:
	pointID = row[0]
	if pointID != None and len(pointID) > 0:

	#event.source.parent.parent.LoadedGraphID = selectedID
window = fpmi.gui.getWindow("CTG_Graph")
window.rootContainer.LoadedGraphID = selectedID2


fpmi.gui.errorBox(“Please select a saved graph.”)

window2 = fpmi.gui.getWindow(“CTG_Graph”)
#table = event.source.parent.parent.getComponent(“ctg_Chart”)
table = window.rootContainer.getComponent(“ctg_Chart”)

system.db.refresh(table, “tagPens”)
system.db.refresh(table, “pens”)

The simplest way I can think to achieve this is as follows:

Set the trend window’s Dock Position property to Floating and its Start Maximised property to True. Then the code on the buttons used to open it would just be system.nav.openWindow('CTG_Graph') This window would open over the top of the current maximised window - you should then put the rest of the code you listed in the trend window’s internalFrameActivated event.

The trend window would contain a simple close button. The code behind this button would be system.nav.closeParentWindow(event) Pressing this would close the trend window, revealing the window which launched it (which was never closed).