Search code examples
javasap-commerce-cloudjco

Hybris Open External link in separated browser tab


i need to open an external link, in separated tab, after a jco call in Hybris 1811. i've created the button and the controller for the jco call, all works fine, but i can't open a new tab in the browser.

using java.awt.Desktop.getDesktop().browse(url); i open a tab in server side,but i need obviouslly open the tab in client's browser.

Can anybody help me?

best regards Marco


Solution

  • You have two options to do this as below:

    1. CMSLinkCOmponent: You can specify target as newWindow/sameWindow like below,
    INSERT_UPDATE CMSLinkComponent;$contentCV[unique=true];uid[unique=true];name;url;&linkRef;target(code)[default='sameWindow']
    
    1. HTML:
    <a href="https://www.google.com/" target="_blank">google.com</a>