RemoteCommand,不在素数中发送参数

问题描述

当我尝试通过远程命令发送参数时,它不发送,在Java中为null。

我的javascript函数没有消失。

example.xhtml

<ui:define name="content">
        
        
    <script type="text/javascript">
        function customfunction() {
            console.log("not here!");
                myMethod([{name: "parm",value: "ok"}]);
        }
    </script>

    <h:form id="dashboardForm" includeViewParams="true">    
        <p:remoteCommand name="myMethod"  action="#{exampleBean.javaMethod}" autoRun="true" />
    

    </h:form>

    ( ... )
</ui:define>



exampleBean.java

(...)


public void javaMethod() {
    String selectedValue = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("parm");         
    this.result = selectedValue;
    
    this.result = selectedValue;
    System.out.println("--------------");
    System.out.println(this.result);
}

(...)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)