This is what I did for those who are interested:
<div class="headerDetails">
<h:panelGroup layout="block" rendered="#{loginTipoController.isEmpresarial()}">
<h1> Nombre Empresa: #{loginController.login.empresa} </h1>
</h:panelGroup>
<h1> Bienvenido: #{loginController.login.nombre}</h1>
</div>
My controller looks like this:
@ManagedBean
@ApplicationScoped
public class LoginTipoController {
private LoginTipo tipo;
public LoginTipo getTipo() {
return tipo;
}
public void setTipo(LoginTipo tipo) {
this.tipo = tipo;
}
@PostConstruct
public void init()
{
tipo = new LoginTipo();
//setting the value from get request
Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
tipo.setTipo(params.get("tipo"));
}
public boolean isEmpresarial()
{
if(tipo.getTipo().equals("emp")) return true;
else return false;
}
}
If the user is "ind", I don't want to show the <h1>
tag. If it is "emp", I want to show the tag.
` (and `
– Tiny Dec 05 '15 at 19:29`, if needed) inside a standard JSF component like `` (or ``) specifying the desired condition in the `rendered` attribute. This will conditionally render an HTML `` element (without `layout="block"`, it will render an HTML `` element, if one of the attributes like `id`, `style`, `styleClass` is specified).