I just upgraded my primefaces library from 3.1.1 to 3.4.1, but unfortunately not able to get the parameter from request parameter map from FacesContext in my bean.
Below are my code snippet.
xhtml file:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:form>
<p:remoteCommand name="setData" actionListener="#{serviceClass.setrealData()}"/>
</h:form>
<script>
$(document).ready(function(){
setData({codes:'J203,J200,J212,J211,J210',fields:'SNAME,SPOT,PERC,POINTS'});
});
</script>
</html>
Bean:
@ManagedBean
@SessionScoped
public class ServiceClass {
/** Creates a new instance of ServiceClass */
public ServiceClass() {
}
public void setrealData(){
FacesContext fc = FacesContext.getCurrentInstance();
Map map2 = fc.getExternalContext().getRequestParameterMap();
String newCodes = (String) map2.get("codes");
System.out.println("New codes ::"+newCodes);
}
}