473
Views
9
Comments
How to open new tab using button/ icon
Question

Hi, I do have a question on how to open a new tab by clicking on an icon or button. I'm using JS in the button's client action, but I'm getting an error that says "can't read the properties of null (reading: click)".

Thank you. 

2021-05-21 21-56-03
Anderson!

UserImage.jpg
ndhrh

Thank you for the reply, but currently there is an icon in the list. I need to click on the icon in the list in order to open a new tab. 

 

For example, I have a list of customers. I need to click on the icon of the selected customer to open a new tab. 

 

2021-05-21 21-56-03
Anderson!

Sorry, I don't know if I understand. Can't you have the icon inside the link like in the image below?

UserImage.jpg
ndhrh

For instance, I have a list similar to the one below. When I click the print button (customer name: Ali), a new tab opens that displays Ali's order receipt.

tempsnipcsc.png
2023-12-14 09-56-57
Yogesh Javir

Hey ,

Try below js code 

window.open("URL", "_blank");

Or 

window.open('url')

Thanks

Yogesh

2020-11-13 07-48-15
Khuong Truong

Hi ndhrh,

I'm not sure why you are using js for button click. 

You can use Button widget and in the Events - OnClick you can choose a detail screen with input parameter as current Id ans set Attributes target = "_blank".

If it required to use js then the error you got saying something that the selector is null (and cannot call click function of null). So you need to check again your select element.

Regards,

Khuong

2024-07-09 07-02-02
Mukul Singh Nathawat

Hi ndhrh,

you just need to add the javascript :

window.open("url",target = "_blank")

and use it in the client action of on click either button or icon. hopefully this will work for you.

ps: you don't need to use target if you have the url you are redirecting to.

thank you,

mukul singh nathawat

2022-04-06 06-33-46
Amitkumar Jirange

Hi ndhrh,

If I understand your problem,  on click of button/link you want to open new page with new tab and with selected data from previous list.


You can achieve this with both button and link.

For button you can call Javascript on button click with input parameter that will work as a query string on next page.

For link you need to simply set traget ="_blank"

Both scenarios have covered in below screenshots

But I would like to share one thing here I have used plain query string which is absolutely not recommended. You can send encrypt data and can decrypt at target page


Hope that solve your issue 



2021-09-15 18-45-49
Dean Abraham

I like to use the link method, since it is easier, and change the style class to "btn", which gives the appearance of a button.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.