2012-05-03 26 views
2

我有一個ViewObject(VO1),它帶有一個指向ViewObject(VO2)的ListOfValue,並從VO2中獲取記錄。 VO2上沒有添加ViewCriteria。 在BC測試儀上測試時,LOV工作正常。無論是在VO1中編輯一行,還是在VO1中創建一行時。Oracle ADF:LOV無法創建

在jspx頁面中使用LOV時,在VO1中編輯行時,LOV可以正常工作。但是當我在jspx頁面中創建一個新行時,LOV不會獲取任何記錄。只是一個空的列表。 我無法弄清楚什麼是錯的,或者它爲什麼不起作用。我創造了幾個LOV,都像魅力一樣工作,但這個讓我把頭髮撕掉。

任何人都會遇到類似的情況,即LOV僅適用於編輯行的情況? 任何想法可能是錯的?

的JSPX頁面上的SOC:

<af:selectOneChoice value="#{row.bindings.IdSosBasGrantType.inputValue}" 
label="#{row.bindings.IdSosBasGrantType.label}" 
required="#{bindings.SosBasCaseGrantPerCaseType.hints.IdSosBasGrantType.mandatory}" 
shortDesc="#{bindings.SosBasCaseGrantPerCaseType.hints.IdSosBasGrantType.tooltip}" 
id="soc12" autoSubmit="true"> 
<f:selectItems value="#{row.bindings.IdSosBasGrantType.items}" id="si11"/> 
</af:selectOneChoice> 

迭代器綁定:

<tree IterBinding="SosBasCaseGrantPerCaseTypeIterator" id="SosBasCaseGrantPerCaseType"> 
<nodeDefinition DefName="fo.att.alm.sos.model.bas.views.SosBasCaseGrantVO" Name="SosBasCaseGrantPerCaseType0"> 
<AttrNames> 
<Item Value="Seq"/> 
<Item Value="IdSosBasGrantType"/> 
<Item Value="IdSosBasGrantVariant"/> 
<Item Value="RuleType"/> 
<Item Value="Status"/> 
<Item Value="IdAplCfgPartyType"/> 
</AttrNames> 
</nodeDefinition> 
</tree> 

的ViewAttribute:

<ViewAttribute 
Name="IdSosBasGrantType" 
LOVName="LOV_IdSosBasGrantType" 
IsUnique="true" 
IsNotNull="true" 
PrecisionRule="true" 
EntityAttrName="IdSosBasGrantType" 
EntityUsage="SosBasCaseGrantEO" 
AliasName="ID_SOS_BAS_GRANT_TYPE"> 
<Properties> 
<SchemaBasedProperties> 
<CONTROLTYPE 
Value="choice"/> 
</SchemaBasedProperties> 
</Properties> 
</ViewAttribute> 

的ListBinding:

<ListBinding 
Name="LOV_IdSosBasGrantType" 
ListVOName="SosBasGrantTypeUsgLOV" 
ListRangeSize="-1" 
NullValueFlag="none" 
NullValueId="LOV_IdSosBasGrantType_LOVUIHints_NullValueId" 
MRUCount="0"> 
<AttrArray Name="AttrNames"> 
<Item Value="IdSosBasGrantType"/> 
</AttrArray> 
<AttrArray Name="ListAttrNames"> 
<Item Value="GrantTypeId"/> 
</AttrArray> 
<AttrArray Name="ListDisplayAttrNames"> 
<Item Value="ObjectTypeDisplayName"/> 
</AttrArray> 
<DisplayCriteria/> 
</ListBinding> 

的ViewAccessor

<ViewAccessor 
Name="SosBasGrantTypeUsgLOV" 
ViewObjectName="fo.att.alm.sos.model.bas.views.SosBasGrantTypeUsgRO" 
RowLevelBinds="true"/> 
+0

你是如何創建新行的? –

+0

使用數據控件下的ViewObject的createInsert操作 – hogni89

回答

0

很難猜測不知道更多的代碼。 但是,如果您有創建新記錄的情況,LOV顯示爲空,也許您在兩個VO之間定義了viewlink。 您需要確保LOV數據來自不是VO1細節的獨立VO2。

+0

它不是級聯LOV,而且LOV數據來自獨立VO2。 它在BC測試儀中工作 – hogni89

0

我想這 1- VO2具有兩個視圖之間限定視圖鏈路Lov區視圖對象對象 2- Lov區視圖對象VO2在其SQL語句來濾除從當前視圖對象VO1和所述參數獲取其值數據參數爲空,因此它不會返回數據

+0

1. VO之間沒有VL。甚至有可能在LOV中使用VL? 2. lov背後的VO沒有參數。它獲取所有記錄 – hogni89

0

嘗試啓用ADF BC調試,並查看在您從頁面調用LOV時,LOV發送給數據庫的查詢是什麼。 編輯您的項目屬性並在Run/Debug頁面中選擇一個運行配置並點擊Edit。然後將字符串-Djbo.debugoutput = console添加到Java選項字段。

http://docs.oracle.com/cd/E16162_01/web.1112/e16182/web_testdebug.htm#BABDBCGF

+0

無論是在BC還是站點運行時,LOV組件都會被正確初始化,並設置相同的綁定變量。 但是LOV組件在BC測試器中工作,但在現場站點上爲空。 我試圖執行查詢,查詢返回正確的記錄。我迷迷糊糊! – hogni89