2012-07-27 26 views

回答

0

如果兩個列表總是有相同的大小,你可以嘗試這樣的事情。

    <ace:dataTable value="#{bean.oldList}" var="item" rowIndexVar="index"> 
        <ace:column headerText="Old Value"> 
         <h:outputText value="#{item.value}"/> 
        </ace:column> 
        <ace:column headerText="New Value">        
          <h:outputText value="#{bean.newList[index].value}"/>        
        </ace:column>     
       </ace:dataTable> 

但是我真的不喜歡這一點,因爲它會導致指數走出界外 或許你也可以嘗試使用嵌套數據表玩。

+0

謝謝,我不知道標籤rowIndexVar! – 2012-07-31 13:28:09