私はOracle ADF と JDeveloperから始めています。最初にいくつかの基本的なチュートリアルを行っています。
HR データベース スキーマから、この演習を試みています。新しい場所を作成しますが、CountryId 属性で、すべての国のリストを表示します。
これはよりユーザーフレンドリーであるため、ユーザーは IT と入力する代わりに Italy を選択できます。
このために、私はこの手順を実行しています:
ロケーションビュー で、CountryId 属性を選択し、 LOV を作成します。これは、CountriesView1から読み取って、値CountryId属性を指定し、CountryName 属性を表示する必要があります。
- ページにLocationsView1をドロップし、ADF フォームを選択します。
- CountryIdをコンボ ボックスとして選択します。
- LocationsView1からCreate操作をボタンとして ドロップします。
- コミット操作をボタンとしてドロップします。
このページを実行すると、すべての国名が表示されますが、そのうちの 1 つを選択すると、選択されたように表示されず、新しいデータをコミットすると、CountryId が null 値で挿入されます。
明らかに、私は間違った方法で何かをしています。リストとして CountryId を使用して、この単純なフォームを作成するにはどうすればよいですか?
誰でも私を助けてもらえますか?
前もって感謝します。よろしくお願いします
編集: dataEntry.jspxのコード
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1" binding="#{backingBeanScope.backing_dataEntry.d1}">
<af:messages binding="#{backingBeanScope.backing_dataEntry.m1}" id="m1"/>
<af:form id="f1" binding="#{backingBeanScope.backing_dataEntry.f1}">
<af:panelStretchLayout id="psl1"
binding="#{backingBeanScope.backing_dataEntry.psl1}">
<f:facet name="center">
<af:panelFormLayout binding="#{backingBeanScope.backing_dataEntry.pfl1}"
id="pfl1">
<af:panelFormLayout binding="#{backingBeanScope.backing_dataEntry.pfl2}"
id="pfl2">
<af:inputText value="#{bindings.LocationId.inputValue}"
label="#{bindings.LocationId.hints.label}"
required="#{bindings.LocationId.hints.mandatory}"
columns="#{bindings.LocationId.hints.displayWidth}"
maximumLength="#{bindings.LocationId.hints.precision}"
shortDesc="#{bindings.LocationId.hints.tooltip}"
binding="#{backingBeanScope.backing_dataEntry.it1}"
id="it1">
<f:validator binding="#{bindings.LocationId.validator}"/>
<af:convertNumber groupingUsed="false"
pattern="#{bindings.LocationId.format}"/>
</af:inputText>
<af:inputText value="#{bindings.StreetAddress.inputValue}"
label="#{bindings.StreetAddress.hints.label}"
required="#{bindings.StreetAddress.hints.mandatory}"
columns="#{bindings.StreetAddress.hints.displayWidth}"
maximumLength="#{bindings.StreetAddress.hints.precision}"
shortDesc="#{bindings.StreetAddress.hints.tooltip}"
binding="#{backingBeanScope.backing_dataEntry.it2}"
id="it2">
<f:validator binding="#{bindings.StreetAddress.validator}"/>
</af:inputText>
<af:inputText value="#{bindings.PostalCode.inputValue}"
label="#{bindings.PostalCode.hints.label}"
required="#{bindings.PostalCode.hints.mandatory}"
columns="#{bindings.PostalCode.hints.displayWidth}"
maximumLength="#{bindings.PostalCode.hints.precision}"
shortDesc="#{bindings.PostalCode.hints.tooltip}"
binding="#{backingBeanScope.backing_dataEntry.it3}"
id="it3">
<f:validator binding="#{bindings.PostalCode.validator}"/>
</af:inputText>
<af:inputText value="#{bindings.City.inputValue}"
label="#{bindings.City.hints.label}"
required="#{bindings.City.hints.mandatory}"
columns="#{bindings.City.hints.displayWidth}"
maximumLength="#{bindings.City.hints.precision}"
shortDesc="#{bindings.City.hints.tooltip}"
binding="#{backingBeanScope.backing_dataEntry.it4}"
id="it4">
<f:validator binding="#{bindings.City.validator}"/>
</af:inputText>
<af:inputText value="#{bindings.StateProvince.inputValue}"
label="#{bindings.StateProvince.hints.label}"
required="#{bindings.StateProvince.hints.mandatory}"
columns="#{bindings.StateProvince.hints.displayWidth}"
maximumLength="#{bindings.StateProvince.hints.precision}"
shortDesc="#{bindings.StateProvince.hints.tooltip}"
binding="#{backingBeanScope.backing_dataEntry.it5}"
id="it5">
<f:validator binding="#{bindings.StateProvince.validator}"/>
</af:inputText>
<af:inputListOfValues id="countryIdId"
popupTitle="Search and Select: #{bindings.CountryId.hints.label}"
value="#{bindings.CountryId.inputValue}"
label="#{bindings.CountryId.hints.label}"
model="#{bindings.CountryId.listOfValuesModel}"
required="#{bindings.CountryId.hints.mandatory}"
columns="#{bindings.CountryId.hints.displayWidth}"
shortDesc="#{bindings.CountryId.hints.tooltip}"
binding="#{backingBeanScope.backing_dataEntry.countryIdId}">
<f:validator binding="#{bindings.CountryId.validator}"/>
</af:inputListOfValues>
<af:commandButton actionListener="#{bindings.Create.execute}"
text="Create"
disabled="#{!bindings.Create.enabled}"
binding="#{backingBeanScope.backing_dataEntry.cb1}"
id="cb1"/>
<af:commandButton actionListener="#{bindings.Commit.execute}"
text="Commit"
disabled="#{!bindings.Commit.enabled}"
binding="#{backingBeanScope.backing_dataEntry.cb2}"
id="cb2"/>
</af:panelFormLayout>
</af:panelFormLayout>
<!-- id="af_one_column_stretched" -->
</f:facet>
</af:panelStretchLayout>
</af:form>
</af:document>
</f:view>
<!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_dataEntry-->
</jsp:root>