I have the following bean class
@ManagedBean
@ViewScoped
@SuppressWarnings("serial")
public class AsrTabBean implements Serializable{
public void save() {
String value = FacesContext.getCurrentInstance().
getExternalContext().getRequestParameterMap().get("name");
System.out.println("name is: " + value);
}
//Getters and Setters
}
My jsf consist of a page with tabs and each tab I am using an include tag to insert each page with its correspondant form.
However, I am trying to test out getting the input value from the input tag and it keeps returning null
<h:form>
<p:panel id="panel" header="Asr Form" style="margin-bottom:10px;">
<p:messages id="messages" />
<h:panelGrid columns="2" cellpadding="5">
<h:outputLabel value="name" />
<p:inputText id="name" />
</h:panelGrid>
</p:panel>
<p:commandButton value="Submit" action="#{asrTabBean.save}" />
</h:form>
result of stdo
name is: null