在開發應用程式時使用 EnterpriseItem Bean、EnterpriseItems Bean 或 Identity Bean Managed Bean,您必須在應用程式組態資源檔案中宣告 Bean。這些宣告確保 JavaServer Faces 的實作,儘可在需要時自動建立 Bean 的新執行個體。Bean 的資源及預設屬性設定也應該在此檔案中加以定義。根據預設,這個檔案叫做 faces
。
注意 faces
檔案也可用來設定定義 Web 應用程式導覽流程的導覽規則。如需更多資訊,請參閱定義導覽規則。
<description>Description of the managed bean.</description>
<managed
<managed
<managed
<property
<value>Default value of the property.</value>
Managed Bean 的基本詳細資料是由 <description>、<managed
<boe:itemsGrid id="myItemsGrid" enterpriseItems="#{enterpriseItems}">
若要使用 enterpriseItems
屬性,讓 ItemsGrid
元件以這種方式參考 EnterpriseItems
Bean,則 Managed Bean 宣告必須存在於 faces
中:
<managed
<managed
com.businessobjects.jsf.appcontrols.model.EnterpriseItems
<managed
<managed
最後,要不使用或使用多個 <managed
<property
<property
<value>#{myButtonProps}</property
#{myButtonProps}
陳述式會參照 SubmitButtonProps
Bean。如需屬性 Bean 的詳細資訊,請參閱我要如何使用結合 JavaServer Faces Components for Crystal Enterprise 的屬性類別?。
JavaServer Faces 實作會在應用程式啟動階段處理 faces
。當第一次從頁面參考 Bean 時,如果沒有 Bean 的執行個體存在,JavaServer Faces 實作就會將它初始化並儲存在定義的範圍中 。Bean 接著即可供應用程式中的所有頁面使用。
Business Objects http://www.china.businessobjects.com Support services http://www.china.businessobjects.com |