I've got an application scoped bean pushing json objects to a channel like this:
        <o:socket channel="controllerEventChannel" onmessage="function(message) {
                var controllerId = message.controllerId;
                var deviceId = message.deviceId;
                var companyKey = message.companyKey;
                onMessage([
                    { name: 'controllerId', value: controllerId },
                    { name: 'deviceId', value: deviceId },
                    { name: 'companyKey', value: companyKey }
                    ]);
        }"
        />
<p:remoteCommand name="onMessage" actionListener="#{controllerGroupDashboardBean.refreshListener()}"
                         update="MainForm:showList MainForm:equipmentView MainForm:mapEquipmentView"/>
But I'm tired of repeating myself and would much rather pass a json array to the channel which could be passed directly to the remote command like this:
        <o:socket channel="controllerEventChannel" onmessage="function(message) {
                onMessage(message);
        }"
        />
<p:remoteCommand name="onMessage" actionListener="#{controllerGroupDashboardBean.refreshListener()}"
                         update="MainForm:showList MainForm:equipmentView MainForm:mapEquipmentView"/>
However, this does not seem to work. I extract the parameters like this:
Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
        
String companyKey = params.get("companyKey");
String controllerId = params.get("controllerId");
String deviceId = params.get("deviceId");
Every parameter resolves to null and, weirdly, the map seems to contain the parameter "undefined" mapped to "" (i.e. blank string).
Anyone?
 
    