Make a hyperlink in Label.CONTENT_RAW open new browsertab

Hi!

I have a label with CONTENT_RAW where i wrap <a href=“URL” /a> around strings which match a URL pattern to make them behave like a normal link. Is it possible to make the browser open a new tab instead of using the same tab in which the application runs?

Background is that i’m writing a chat application and a chatline consists of a HorizontalLayout with 3 labels: 1 for the timestamp, 1 for the username and 1 for the message. I already tried to split the message into a stringarray with message.split(" ") and wrap a label around each word in the message and put a Link object around URL-patterns when necessary, but this approach is really ugly i think and it leads to further errors.

Any ideas are welcome. Thanks in advance!

Hi,

In a word, no.

See
this stackoverflow discussion
for a bit more blurb.

You can use target=“_blank” which opens the url in a new window or a new tab depending on a the browser and (sometimes) the user’s preference settings - that’s the only option open to you, I’m afraid.

Cheers,

Charles.