b:navLink action is never invoked

2k views Asked by At

I'm currently writing a webapp using bootfaces. In my application I have a top navigation bar like the following

        <b:navBar brand="Brand" brandHref="#" inverse="true">
            <b:navbarLinks>
                <b:navLink value="Home" href="#"></b:navLink>
                <b:navLink value="Link" href="#"></b:navLink>
                <b:navLink value="Link" href="#"></b:navLink>

                <b:dropMenu value="#{loginBean.username}">
                    <b:navLink value="Logout" action="#{loginBean.doLogout}"/>
                </b:dropMenu>
            </b:navbarLinks>
        </b:navBar>

Notice action="#{loginBean.doLogout}"

With primefaces, this works no problem, but when I migrated to bootfaces doLogout is never executed. Is there another binding I need to use in bootfaces to make this action get executed?

2

There are 2 answers

1
user3780616 On

Looks like I needed to do the following

<b:navLink value="Logout" href="#{loginBean.doLogout()}"/>
2
juangon On

Seems that the new BootsFaces version adds a new component (b:navCommandLink) so it behaves like a commandLink.