1

I am using Bootsfaces 1.0.2 and JSF 2.2. If I wanted for the brandHref on the navBar component to open on a new tab, how could I accomplish this? In HTML I can use target=_blank but how would I be able to do the same with the navBar component in JSF? Is my only option using JavaScript?

<b:navBar
            brand="Brand"
            brandHref="http://www.google.com" inverse="false" position="bottom"
            sticky="false">

        </b:navBar>
Erick
  • 823
  • 16
  • 37

1 Answers1

2

I suggest you open an issue on our bug tracker and ask us to add the target attribute with the next version of BootsFaces. BootsFaces 1.1.0 is currently in the ramp-up phase, so I'm afraid it's too late to include this feature with BootsFaces 1.1.0.

In the meantime, you can use a pass-through attribute. The disadvantage is that the pass-through attribute appears at every level of the navbar. To my surprise, I didn't observe problems caused by the ubiquitous target attribute, so you might give it a try:

<ui:fragment ...
  xmlns:pt="http://xmlns.jcp.org/jsf/passthrough">
  ...
  <b:navBar brand="BootsFaces" 
      brand-href="http://www.bootsfaces.net/" 
      pt:target="_blank">
Stephan Rauh
  • 3,069
  • 2
  • 18
  • 37
  • 1
    Thanks @Stephan. I opened the issue here: https://github.com/TheCoder4eu/BootsFaces-OSP/issues/728 – Erick Apr 23 '17 at 22:52