2013-04-11 66 views
0

中呈現的值因此,繼承人它的骨感。我的selectOneMenu上有一個渲染標籤。我以各種方式嘗試過,最後一個用「@form」更新布爾複選框中的表單。我完全沒有想法,一直在爲此工作幾天。我錯過了什麼,所以我可以根據複選框的選擇來渲染/取消渲染?謝謝。複選框將不會更新表

<rich:dataTable id="catalogview" width="100%" style="width: 100% !important" 
    columnClasses="lcolumnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog,columnCatalog" 
    value="#{pcnAlerts.notifications}" var="pcn" rows="20" 
    headerClass="headerCatalog" styleClass="table1" footerClass="footer_td" > 
    <h:column> 
     <h:selectBooleanCheckbox value="#{pcn.checked}" update="@form" > 
      <f:ajax listener="#{pcnAlerts.selectItem}" render=":popupForm:popupPanelContents" /> 
     </h:selectBooleanCheckbox> 
    </h:column> 
    <h:column> 
     <f:facet name="header">        
      <h:outputText value="Status" /> 
     </f:facet> 
     <h:outputText value="#{pcn.status}" /> 
     <h:selectOneMenu id="StatusMenu" value="#{pcnAlerts.newStatus}" rendered="#{pcn.checked}"> 
      <a4j:ajax update="StatusMenu" listener="#{pcnAlerts.saveStatus()}" /> 
      <f:selectItem itemValue="" itemLabel="New" /> 
      <f:selectItem itemValue="Pending" itemLabel="Pending" /> 
      <f:selectItem itemValue="Complete" itemLabel="Complete" /> 
      <f:selectItem itemValue="Archive" itemLabel="Archive" /> 
      <f:selectItem itemValue="Disregard" itemLabel="Disregard" /> 
     </h:selectOneMenu> 
    </h:column> 
</rich:dataTable> 

回答

0

您還必須更新catalogview才能呈現表格中的組件。此外,請確保您的<rich:dataTable><h:form>內:

<h:form id="frmCatalog"> 
    <rich:dataTable id="catalogview" value="#{pcnAlerts.notifications}" var="pcn"> 
     <h:column> 
      <h:selectBooleanCheckbox value="#{pcn.checked}"> 
       <f:ajax listener="#{pcnAlerts.selectItem}" 
        render=":popupForm:popupPanelContents :frmCatalog:catalogview" /> 
      </h:selectBooleanCheckbox> 
     </h:column> 
    </rich:dataTable> 
</h:form> 
+0

難道形式只能是這樣,在渲染refernced?我試圖更新目錄視圖,但由於它立即上升,我沒有包括所有這些。 – 2013-04-11 20:42:39

+0

另外,你的意思是把它放在渲染?我認爲屬於更新,對吧? – 2013-04-11 20:49:24

+0

@ user1582340 ['''沒有'update'屬性](http://www.jsftoolbox.com/documentation/help/12-TagReference/core/f_ajax.html),你的意思是'render'。 AFAIK支持ajax功能的PrimeFaces組件具有'update'屬性。 – 2013-04-11 21:10:19