【问题标题】:How to pass value to setPropertyActionListener in remoteCommand如何在 remoteCommand 中将值传递给 setPropertyActionListener
【发布时间】:2012-07-02 12:57:19
【问题描述】:

我想在remotecommand 中使用setPropertyActionListener#{viewScope.newLOBType} 分配一个动态值(如下所示),那么如何将值从Javascript 传递到这里?

代码:

<p:remoteCommand name="showPanel" update=":createLOBPanel">
    <f:setPropertyActionListener target="#{viewScope.newLOBType}" value="..<dynamic value from JavaScript>.. "/>
</p:remoteCommand>

【问题讨论】:

    标签: jsf primefaces


    【解决方案1】:

    一种方法可能是:

    定义

    <h:inputText id="myHiddenValue" style="display:none" value="#{viewScope.newLOBType}"/>
    

    然后使用js或jquery设置其值$("#myHiddenValue").val("wooot");

    然后

    <p:remoteCommand process="myHiddenValue" name="showPanel" update=":createLOBPanel">
    

    【讨论】:

    • @mohsinazeem,如果您知道更好的方法,请随时与他人分享,欢迎您。
    猜你喜欢
    • 1970-01-01
    • 2021-08-14
    • 2021-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-12
    相关资源
    最近更新 更多