2014-03-03 34 views

回答

1

PrimeFaces offers p:remoteCommand。它可以通過javascript調用並執行,執行動作和ajax進程和更新。使用p:commandLinktimeout調用javascript函數。總之

<p:commandLink onclick="delayIt()" /> 

<p:remoteCommand name="remoteCommandName" ... action ... update ... process/> 


<script type="text/javascript"> 
    var delayIt = function(){ 
     setTimeout(remoteCommandName,5000) //don't write() as it would execute it immediately 
    } 
</script> 
+0

謝謝你的迴應 –

1

在primefaces中嘗試'延遲'作爲屬性。默認情況下,延遲爲空。

<p:commandLink id="clid" actionListener="#{buttonView.buttonAction}" delay="1000"> 
    <h:outputText value="text" /> 
</p:commandLink>