0

am working on an application and the designer drive me crazy. it's a jsf application with primefaces v.6 and apache tomcat v.7.

I have the following html code from designer

<a href="#"><i class="fa fa-sign-out"></i>Logout</a>

when the user click on it, he logout from the application.

When i use a commandLink

 <h:form>
    <p:commandLink action="#{loginBean.logout}" value="Logout"/>                            
</h:form>

it renders a form with hidden input-fields with an HTML anchor. therefore the link does not look like the one of my designer (CSS).

And when i use outputLink so that i can just have an anchor, it's not possible to call the bean method.

And it's also not possible to get this tag <i class="fa fa-sign-out"></i> inside the anchor-element like it was designed.

I hope, i was a lil clear, how can i resolve this problem? To have a jsf-link-compenent or any other technic (jsf, primefaces) that can renders something like <a href="#"><i class="fa fa-sign-out"></i>Logout</a>

I prefer the commandLink because of the capability to call a bean method

Any help will be welcome

Thanks!

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Willy Tcha
  • 11
  • 5

1 Answers1

0

I have never used the primefaces framework, but if I understood you correctly, the p:commandLink tag has a styleClass attribute which you can fill with your fa fa-sign-out classes.

http://www.primefaces.org/docs/vdl/6.0/core/primefaces-p/commandLink.html

If that does not work, you could also put a h:outputText tag inside the p:commandLink and use the outputText styleClass attribute for the same effect.

Damntry
  • 35
  • 1
  • 7