层叠面板的刷新

Refresh of cascading panels

级联面板上的内容刷新是否有问题,其中包含连接到主面板对象的对象?主面板的数据源为 "Invoice"(托管 bean),级联面板的内容为 "Invoice.getAllInvoiceItems()" 对象列表 (InvoiceItem)。

主面板(我在 beforePageLoad 事件中加载 bean,而不是在主面板中):

 <xp:view xmlns:xp="http://www.ibm.com/xsp/core"
    xmlns:on="http://www.openntf.org/domino/xsp"
    xmlns:xc="http://www.ibm.com/xsp/custom"
    xmlns:xe="http://www.ibm.com/xsp/coreex">
    <xp:this.beforePageLoad><![CDATA[#{javascript:Invoice.pageInit();}]]>        
    </xp:this.beforePageLoad>
  <xp:panel id="mainpanel" rendered="#{javascript:Invoice.getValid();}"
        readonly="#{javascript:Invoice.readOnly;}"> 

级联面板:

<xp:panel id="RepeatInvoiceItems">
    <xp:this.data>
        <xe:objectData var="invoiceItem"
            createObject="#{javascript:Invoice.getAllInvoiceItems()}">
        </xe:objectData>
    </xp:this.data>

我在 Faces-config 中将 Invoice 配置为托管 bean,但没有配置 InvoiceItem,因为我认为没有必要...

   <managed-bean>
    <managed-bean-name>Invoice</managed-bean-name>
    <managed-bean-scope>view</managed-bean-scope>
    <managed-bean-class>com.kitc.controller.ControllerInvoice</managed-bean-class>
   </managed-bean>

我的问题是,当我创建一个新的 InvoiceItem 时,包含 InvoiceItems 的面板不会刷新,但包含 Invoice 的面板会刷新(证明方法 Invoice.getTotalPrice() returns 的计算值所有(包括新的)InvoiceItems)。

为什么要使用 objectData,您可以将 Invoice.getAllInvoiceItems() 直接绑定到 repeatControl 并将新的 invoiceItem 绑定到 bean

的 属性