opening a pui program in a new tab

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
amc
Profound User
Posts: 67
Joined: Thu Jul 29, 2010 1:25 am
First Name: Tony
Last Name: Cusack
Company Name: Welding Industries
City: Adelaide
State / Province: Outside Canada/USA
Zip / Postal Code: 5139
Country: Australia
Location: Adelaide, South Australia
Contact:

opening a pui program in a new tab

Post by amc »

Hi,
I have a PUI program running in an Atrium Tab. I want to click a button in that program to open & new PUI program in a new tab & change to that tab.
So, in the program I put a button with onclick event code

Code: Select all

tabref = Atrium.launchItem(117);  Atrium.activate(tabref);
117 if the program id I obtain from the edit navigation in Atrium Control Panel. When I click on the button, I get this error from chrome
chrome.png
chrome.png (9.93 KiB) Viewed 3828 times
and this error from firefox
ff.png
ff.png (4.39 KiB) Viewed 3829 times
Can somebody help me with the correct method to achieve what I want.
Thanks
Tony C
(P.S. this is version 3.0.0)
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: opening a pui program in a new tab

Post by David »

There are two problems here:

1. You've run into a bug with 3.0.0 when using the Atrium.launchItem() API in conjunction with the Accordion-style menu. This will be fixed for the next update.

In the meanwhile, I've attached a patch that you can apply to fix this problem. To apply the patch, copy the file into your /www/profoundui/htdocs/profoundui/proddata/js folder, overwriting the original file.

This will allow the item to launch properly.

2. In your code, there is a slight problem. There is no Atrium.activate() API. Try Atrium.activateTab() instead.
Attachments
atrium.js
(86.31 KiB) Downloaded 408 times
amc
Profound User
Posts: 67
Joined: Thu Jul 29, 2010 1:25 am
First Name: Tony
Last Name: Cusack
Company Name: Welding Industries
City: Adelaide
State / Province: Outside Canada/USA
Zip / Postal Code: 5139
Country: Australia
Location: Adelaide, South Australia
Contact:

Re: opening a pui program in a new tab

Post by amc »

Thanks David,

replaced the js file & corrected the script - all now works as expected.
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: opening a pui program in a new tab

Post by David »

Great! Glad to hear it's working well.
amc
Profound User
Posts: 67
Joined: Thu Jul 29, 2010 1:25 am
First Name: Tony
Last Name: Cusack
Company Name: Welding Industries
City: Adelaide
State / Province: Outside Canada/USA
Zip / Postal Code: 5139
Country: Australia
Location: Adelaide, South Australia
Contact:

Re: opening a pui program in a new tab

Post by amc »

David,

Can I retract my statement about all being well.

What actually happens is this.

If the PUI program #117 hasn't been opened since atrium login, then the button in the first program doesn't load it & change to it's tab - nothing happens.

However, if PUI program 117 has been open since login, then , even if it is since closed, the button in the first program will load it & change to it's tab (as expected). If PUI program 117 is still open, it will change to the correct tab (as expected).

so it looks like it's 50% fixed.

regards

Tony C
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: opening a pui program in a new tab

Post by David »

I think I might have some idea.

It seems that if the menu item is not visible (it doesn't really matter if it's actually been used or not), then the Atrium.launchItem() API is not able to call it.

Is that what you're seeing?
amc
Profound User
Posts: 67
Joined: Thu Jul 29, 2010 1:25 am
First Name: Tony
Last Name: Cusack
Company Name: Welding Industries
City: Adelaide
State / Province: Outside Canada/USA
Zip / Postal Code: 5139
Country: Australia
Location: Adelaide, South Australia
Contact:

Re: opening a pui program in a new tab

Post by amc »

yes David, you are correct, if the menu is expanded, its starts correctly even if it hasn't been run once.

Is there some switch that will cause the menus to be expanded on startup as they were previously ?
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: opening a pui program in a new tab

Post by David »

You are right -- this is a problem with 3.0.0 that relates to the fact that the menus are no longer loaded all at once.

We've made a fix for the next update that will allow Atrium.launchItem() to retrieve the menu item details, even if it's not been loaded yet.

Keep an eye on the update check -- we should have an update available in the coming days.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests