| Author |
Message |
|
bradldaley
Trooper
Joined: Wed Sep 09, 2009 1:23 pm Posts: 14
|
 Nav Bar / Left Bar
I am using the skeleton project template. Is there a way that I can change the nav bar with a button click on it.
I have three different types of facilities, Potable, Recycled and Wastewater. I would like to build 3 nav bars for those types and be able to switch the nav bars with buttons on the bars. Is this possible?
_________________ Brad L Daley Systems Analyst MNWD OC, Ca.
|
| Wed Mar 16, 2011 8:05 am |
|
 |
|
Robert.McKenzie
Moderator
Joined: Wed Apr 18, 2007 11:00 am Posts: 390 Location: Sacramento Ca.
|
 Re: Nav Bar / Left Bar
Yes, just use the system.nav.swapWindow() function in your button to swap it to another nav window. More info here.
_________________ Robert McKenzie Inductive Automation Technical Support
|
| Wed Mar 16, 2011 11:16 am |
|
 |
|
bradldaley
Trooper
Joined: Wed Sep 09, 2009 1:23 pm Posts: 14
|
 Re: Nav Bar / Left Bar
Guess I wasn't specific enough. I am not using Ignition. Im trying to swap the LeftNav and tabstrip that comes with the skeleton layout. Currently when I try to swap this tabstrip it swaps for the window that is open in the main area, Not the tabstrip itself. Do I have to disable the navagation mode and script all of the tabs?
_________________ Brad L Daley Systems Analyst MNWD OC, Ca.
|
| Thu Mar 17, 2011 8:00 am |
|
 |
|
Robert.McKenzie
Moderator
Joined: Wed Apr 18, 2007 11:00 am Posts: 390 Location: Sacramento Ca.
|
 Re: Nav Bar / Left Bar
Ah yes, sorry. I didn't look at what forum you posted in. Yes, you are exactly right. The Tab Strip component uses the swapTo() function where you want the swapWindow() function (in fpmi.nav). You will have to set the Tab strip Navigation Mode to 'Disabled' and add a script to the propertyChange event that takes the new selectedTab value and opens that window.
_________________ Robert McKenzie Inductive Automation Technical Support
|
| Thu Mar 17, 2011 8:10 am |
|
 |
|
bradldaley
Trooper
Joined: Wed Sep 09, 2009 1:23 pm Posts: 14
|
 Re: Nav Bar / Left Bar
Getting an error message. Am I way off here?
_________________ Brad L Daley Systems Analyst MNWD OC, Ca.
|
| Thu Mar 17, 2011 11:12 am |
|
 |
|
dave.fogle
Moderator
Joined: Wed Dec 01, 2010 1:12 pm Posts: 228
|
 Re: Nav Bar / Left Bar
You're likely getting this error because you are trying to put that script into a property binding as opposed to an event script. If you right click on the tab strip and the click on configure actions you can then add your script to the property change section.
You're going to want to filter on event.propertyName =='string' instead of propertyChange I believe.
_________________ Dave Fogle Technical Support Inductive Automation
|
| Thu Mar 17, 2011 12:43 pm |
|
 |
|
Robert.McKenzie
Moderator
Joined: Wed Apr 18, 2007 11:00 am Posts: 390 Location: Sacramento Ca.
|
 Re: Nav Bar / Left Bar
Your script should look like: Code: if event.propertyName == "selectedTab": system.nav.swapWindow(event, event.newValue)
_________________ Robert McKenzie Inductive Automation Technical Support
|
| Thu Mar 17, 2011 1:28 pm |
|
 |
|