sorry for bad engl~
Primefaces: 5.0
JSF 2.1.26
Mojarra 2
Jboss 6
My doubt is how to get the value of a parameter sent by a menu created in the bean?
I know it's a very beginner question, but the google search and the forum only shows how to send the parameter rather than receive...
Xhtml:
Code: Select all
<p:menubar id="menu" model="#{cabecalhoBean.menuModel}" styleClass="NG_Menu" />
Code: Select all
final DefaultMenuItem item = new DefaultMenuItem(((MenuElement) menu).getLabel());
item.setUrl(((MenuElement) menu).getComando());
item.setParam("teste", "teste1");
Code: Select all
@ViewScoped
@ManagedBean
public class CestaDfuBean {
private String teste;
@PostConstruct
public void init() {
//This is moment when I need have paramValue, in this moment
//global variable is null and code below too...
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("teste");
}
public String getTeste() {
return teste;
}
public void setTeste(final String teste) {
this.teste = teste;
}
}