I have a JSF site using primeFaces. I cannot get any parameters from my javascript to my bean using P:RemoreCommand. Here is my code:
xhtml:
<p:remoteCommand name="scaleLines" actionListener="#{mapBean2.scaleLines}" update="mapPanel"/>
Then later to call it:
map.on('viewreset', function(){
scaleLines({newZoom:'10'});
});
Session Scoped ManagedBean:
public void scaleLines(){
String newZoom = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("newZoom");
if(newZoom == null){
Logger.getAnonymousLogger().info("Zoom level is null");
}
else{
Integer newZoomInt = Integer.parseInt(newZoom);
this.mapzoomLevel = newZoomInt;
for(ZsyMap1Linetest line : allTestLines){
line.setWeight(((line.getWeight()*newZoomInt)/(6)));
}
}
}
This does call the method, but when I attach a debugger, I can see that newZoom is always null meaning that the parameter does not get passed. I hhave read other posts and I can't see why it would not get passed. I also tried this using a JSF managedBean for the backing bean and a CDI named bean, bOth had the same results.