I want to do the following: active o inactive a menuitem with management bean (MB), I want to use properties \"renderer\". But I don\'t Know like do it.
My code is
While I was finding answers, I got the following:
This my code in xhtml:
I use properties "redered", rendered="#{activacionOpcionesMB.activarItemPermisos()}", where activacionOpcionesMB.activarItemPermisos() is my MB.
This is my MB:
package co.com.patios.mb.util;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
@ManagedBean (name = "activacionOpcionesMB")
@RequestScoped
public class ActivacionOpcionesMB {
public boolean registrarPatio = true;
public void activarItemPermisos(){
if(true){
registrarPatio = false;
}
}
}
"registrarPatio" is the data that I use for active o unactive menuItem, for default it's true.
The method activarItemPermisos() is where I active the menuItem, here I use conditional and after I assing to registrarPatio false.
You can use "if" for validate access to the different option in their applications.