I am using primefaces 6, I want to call primefaces remote command with Javascript, and I want to pass parameters to it.
The remote command code is as the following
<h:form>
<p:remoteCommand name="dummyAction"
actionListener="#{usedController.exec}"/>
</h:form>
Then i tried to call the remote command in an accordionpanel like the following
<p:accordionPanel onTabClose="dummyAction([{name1:'value1',
name2:'value2'}]); "
and i added this method in the Managedbean
public void exec() {
FacesContext context = FacesContext.getCurrentInstance();
Map map = context.getExternalContext().getRequestParameterMap();
String name1 = (String) map.get("name1");
String name2 = (String) map.get("name2");
}
I started debugging and i found that the values of the string name1 and name2 are always null, as the map doesn't contain its key, how could i fix this so i could get the proper values?