commandlink disabled still triggers the action

277 Views Asked by At

I have a custom tag in which I use a commandLink tag. The problem is that in some cases I want the action that happens in the back not to happen, actually to disable the link, but in some cases I want the link to work.

<p:commandLink action="#{bean.doSomething(param)}" styleClass="line" disabled="#{disable}"> 
    <div> bla </div> 
</p:commandLink>

In this example 'disable' is a boolean parameter that I receive from the outside of the custom tag. How can I block the action for commandLink based on a boolean parameter or any other method?

0

There are 0 best solutions below