标签: remotecommand

从JavaScript传递参数到p:remoteCommand

我想remoteCommand从javascript 传递价值.如果可以的话,我怎么能这样做,如何在支持bean中接收它们?

javascript parameters jsf primefaces remotecommand

48
推荐指数
4
解决办法
6万
查看次数

使用ap:remoteCommand更新ap:dataTable

给定以下XHTML代码,其中包含一个<p:inputText><p:dataTable>只有两列.

<p:remoteCommand name="updateTable" update="dataTable"/>

<p:panel id="panel">
    <p:inputText id="txtValue" value="#{testManagedBean.txtValue}"
                 required="true"/>
    <p:message for="txtValue" showSummary="false"/>
    <p:commandButton actionListener="#{testManagedBean.submitAction}"
                     oncomplete="if(!args.validationFailed) {updateTable();}" 
                     update="panel" value="Submit"/>
</p:panel>

<p:panel id="dataTablePanel" header="Data">
    <p:dataTable id="dataTable" var="row" value="#{testManagedBean}"
                 lazy="true"
                 pageLinks="10"
                 editable="true"
                 rowsPerPageTemplate="5,10,15"
                 rows="10"
                 rowKey="#{row.catId}"
                 editMode="row">

        <p:ajax event="rowEdit" update=":form:panel dataTable"
                listener="#{testManagedBean.onRowEdit}"/>

        <p:column id="id" headerText="Id">
            <h:outputText value="#{row.catId}"/>
        </p:column>

        <p:column id="catName" headerText="Category">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{row.catName}"/>
                </f:facet>
                <f:facet name="input">
                    <p:inputText value="#{row.catName}" label="Category">
                        <f:validateLength minimum="2" maximum="45"/>
                    </p:inputText>
                </f:facet>
            </p:cellEditor>
        </p:column>

        <p:column headerText="Edit" width="100">
            <p:rowEditor/>
        </p:column>
    </p:dataTable>
</p:panel>
Run Code Online (Sandbox Code Playgroud)

<p:commandButton>按下给定时,将submitAction() …

jsf primefaces jsf-2.2 remotecommand

4
推荐指数
1
解决办法
8641
查看次数

Primeface的remoteCommand - 有办法执行一次吗?

Primefaces 3.5 JSF 2.1

\n\n

I\xc2\xb4m 使用 p:remoteCommand 执行异步命令并在页面加载后更新我的视图,但看起来在每次迭代结束时它会再次执行等等...

\n\n

这种行为正确吗?

\n\n

如何只执行一次p:remoteCommand?

\n\n

更新

\n\n

我已经检查过我的远程命令不在更新面板中,所以感谢您的回答,但已经可以了。我如何解决我的问题:

\n\n

我不知道为什么,但使用 Omnifaces 的 onloadScript ( http://showcase.omnifaces.org/components/onloadScript ) 来调用它被调用多次的 RemoteCommand 函数,但使用 $(document).ready ...仅一次。所以,我改变了它,现在就可以使用了。

\n

jsf primefaces remotecommand

3
推荐指数
1
解决办法
2万
查看次数