How to open a new window using UI action javascript after clicking a button?

calvinlo
Kilo Explorer

I have tried to create a UI button and want to open a new window with a url using the button.

It seems that window.open does not work and I notice that there is a function action.setRedirectURL().

Does anyone how to open a new window?

14 REPLIES 14

Ashish Kumar Ag
Kilo Guru

Client : True


Onclick : redirect()



Script:



function redirect(){


window.open('your url','_blank');


}


Thanks. Using client script, window.open will work properly,


Hi ashish,

I have one question regarding " window.open(url, '_blank') "
How can I prevent the user to open the same url again and again?


The above open a specific url in a new window, but if I will click this UI Action again it will open another window (tab) in the browser, can we handle this? to lead the user to the opened one if already exist?

Tnx,
Aviv

grantsteffek
Kilo Explorer

hi there. Any luck with this? I have exactly the same issue in that window.open() does not open a new window. I create an OnClick event, then the function is defined in the script area, but when trying to use window.open(url) nothing happens..... I have even tried the action.setRedirectURL but that doesnt redirect to a page either. For various reasons, I want to use the OnClick functionality and use window.open().... help please. thanks very much