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.
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.
Sorry, I don't know if I understand. Can't you have the icon inside the link like in the image below?
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.
Hey ,
Try below js code
window.open("URL", "_blank");
Or
window.open('url')
Thanks
Yogesh
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
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
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
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.