w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

Open link in new window/other browser

How can I make a link open in a completely new window or external browser, instead of in the native app container (which is basically a browser wrapped in a native container)?
Because in my application, when I click an external link, it opens in the app window itself. Then when I go back, all dynamic fields in my app are gone. Only static labels etc are still there, but all dynamically generated grids, select menus etc. that depend on a service are empty. Also I think the sessionstorage is cleared.
So that's why I want to open links in an external browser or new window.

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

Open link in new window/other browser

Try childBrowser plugin.
precodefunction windowOpen(url) {
var cb;
if(window.plugins) {
cb = window.plugins.childBrowser;
}
if (cb != null) {
cb.showWebPage(url);
}
else {
window.open(url);
};
}

windowOpen("http://appery.io/");
/code/pre

w
Posts: 0
Joined: Tue Mar 26, 2013 12:30 pm

Open link in new window/other browser

window.open works perfectly. Thanks Oleg!

Erwin Oliva
Posts: 0
Joined: Wed Mar 12, 2014 6:36 am

Open link in new window/other browser

Hello,
I am using the UI component LINK to map my REST service results to a Google Map Info Window. When the LINK component is clicked it opens up on the current window.

I am not sure how I can use the above scripts to allow opening of the LINK on a new window. Does the above script require that I store data in local storage and then use the click event to launch a javascript instead? Is there a way that the LINK UI component be configured to automatically open on a new window instead?

Would appreciate some help.

Thank you!

Erwin Oliva
Posts: 0
Joined: Wed Mar 12, 2014 6:36 am

Open link in new window/other browser

Hi Igor, Thanks for the suggestion. It seems that using javascript window.open() and navigate to link on click event won't work inside a Google Map info window. I have tested with a simple navigate to link on a click event on an image that I had inside the google map info window, and it won't even recognize that the image is clickable. However, I have a LINK inside the info window, and it does launch the link, but then not on a new window as preferred.
Has anyone tried using window.open or navigate to link from a Google map info window?

Thanks.

Erwin Oliva
Posts: 0
Joined: Wed Mar 12, 2014 6:36 am

Open link in new window/other browser

Hi again Igor. Let me correct myself. I have successfully tested window.open on an image inside a google map info window, and it works.

Erwin Oliva
Posts: 0
Joined: Wed Mar 12, 2014 6:36 am

Open link in new window/other browser

I ended up using a label to map the url inside an info window in google map.
On click of the label, I invoked window.open(Appery('urllabel').text())

Cheers.

Return to “Issues”