Reputation: 12413
What i want is to open a page in a new tab but don't give focus to the new opened tab. So if i click a few times i can open a few tabs.
Just as if i right clicked a link and said open in new tab(I tried that only in chrome and firefox browsers).
Do you know is it possible?
Currently i open new tabs using a form with a button that looks like this:
<h:form target="_blank">
<h:commandButton action="#{mainPageBB.toLink}"/>
</h:form>
Upvotes: 3
Views: 3398
Reputation: 1108537
As with many other things which changes the client default behaviour, that's simply not possible by HTML/JS, so JSF as being just a HTML/JS code generator already can't do much for you. It could namely be experienced as intruding and thus result in Bad User Experience, that's also why among others the target="_blank"
is deprecated. Best what you can do is to add some non-disturbing and helpful remark that the enduser could use Ctrl+Click to open the links in new tabs without focusing it.
<p class="note">Consider using Ctrl+Click whenever you want to open links in the background in new tabs.</p>.
Still then, this could be a browser-specific/dependent configuration setting, so it may not work that way in all browsers. After all, just provide a bunch of links and let the client decide what to do with it.
Upvotes: 4