Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
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.