2014-09-30 22 views
0

我必須在我的表中動態呈現一行而不刷新整個表。使用JSF Primefaces - 在僞組件中包含p:行

<p:outputPanel> 
    <p:panel> 
    <p:panelGrid> 
     <p:row> 
     <p:column> 

要動態地呈現一排,而無需刷新整個表生成的表格,我應該能夠包括像跨度啞分量該行。然後在我的p:ajax更新中,我應該給出這個虛擬組件id。

我的理解是否正確?這個怎麼做?

回答

1

只要給該行一個id並使用p:ajax或commandbutton或其他來更新它即可。

事情是這樣的:

<p:panelGrid id="panelGrid" style="width: 100%;"> 

         <p:row id="rowToUpdate"> 
          <p:column>#{playgroundView.testB}</p:column> 
         </p:row> 

         <p:row> 
          <p:column>{playgroundView.testA}</p:column> 
         </p:row> 
    </p:panelGrid> 

<p:commandButton value="Ajax Submit" id="ajax" styleClass="ui-priority-primary" actionListener="#{playgroundController.alterTest()}" update="rowToUpdate" /> 

按鈕只會更新/刷新第一行。