Developer Tools
JDeveloper
You can work in JDeveloper's IDE to add List-of-Values (LOV) components to the pages.
Create a Static View Object: Create a static view object for the status code values.
Create a Static LOV: Create a static LOV for the order status code field on the edit page, so the order status description is displayed in a dropdown list box.
Create a Lookup View Object: Create a lookup view object for the Customer Id field, so that customer names can be displayed instead of customer id values on the edit page.
Create a Dynamic LOV: Create a dynamic LOV for the Customer Id field on the edit page, so the customer name is displayed in a dropdown list box.
Test the LOV: Run the application in the IDE and try out the choice lists.
A static LOV (list of values) is based on a view object where transient attributes are created and populated with values at design time. You will define a new view object, populate it with the static values needed for the LOV, and associate it with the existing view object that will use it as an LOV. [ tell me more...]
StatusCodes as the view object name. Select
Rows popula
ted at design time (Static List)
, and click
Next
.
Status as the name of the attribute and select
Key Attribute
. Then click
OK.
StatusDesc as the name of the attribute and click
OK. Then click
Next
twice.
Add seven times to add seven blank rows. Then create the static list values by entering the values for
Status and
StatusDesc as shown here:
PENDING Order submitted
SHIP Order being shipped
PICK Order being picked
COMPLETE Order completed
CANCEL Order cancelled
STOCK Waiting for stock
CART Order in cart
When you define a static list for a view object, if not already created, JDeveloper creates a standard message bundle file in which to store the values. The message bundle file is specific to the view object component to which it is related, and it is named accordingly. Internationalizing the model layer of an application built using ADF Business Components entails producing translated versions of each component's message bundle file. For example, the Italian version of the
modelBundle.properties message bundle would be a class named
modelBundle_it.properties, and a more specific Swiss Italian version would have the name
modelBundle_it_ch.properties. [
tell me more...]
Add.
After adding the StatusCodes view object as a view accessor to the OrdersView view object, the View Accessors page of the overview editor should look like this: [ tell me more...]
A static LOV is based on a view object where transient attributes are created and populated at design time. In the previous cue card, you created a list of codes in the static view object StatusCodes and associated the view object with the OrdersView view object through a view accessor. In this cue card, you will enable OrdersView to be used as the provider for the static LOV in the user interface. For OrdersView to use the static list in StatusCodes as an LOV, first you have to configure OrdersView to use an LOV. [ tell me more...]
Add next to
List of Values: OrderStatusCode.
To configure the user interface for the LOV-enabled attribute ( OrderStatusCode), you specify the view accessor that supplies the list data at runtime, and the attribute that is the data source for the list. [ tell me more...]
A model-driven list is based on an LOV that is bound to a view data object. [ tell me more...]
After defining the OrderStatusCode attribute in OrdersView as the LOV-enabled attribute, the Attributes page of the overview editor should look like this: [ tell me more...]
A dynamic LOV is based on a view object where a SQL statement is used to populate the list of values. You will define a new view object and specify a query that retrieves all customers to use as the basis for the LOV. [ tell me more...]
CustomerView as the name of the view object. Select
Rea
d-only access through SQL query
, and click
Next
.
SELECT * from PERSONS Persons
WHERE Persons.PERSON_TYPE_CODE = 'CUST'
Add.
The View Accessors dialog is available from the
View Accessors tab in the entity object overview editor when you click
. Use the View Accessors dialog to add the new view object
CustomerView as a view accessor to the
Orders entity object. [
tell me more...]
In the Application Navigator, the model project contains CustomerView, the new SQL-only view object you created that has read-only access to the database: [ tell me more...]
A dynamic LOV is based on a view object where a SQL statement is used to populate the list of values at runtime. In the previous cue card, you created the lookup view object ( CustomerView) based on a query that retrieves all customers for use as the basis for the list of values. You also made the lookup view object available to the Orders entity object by adding it through a view accessor. [ tell me more...]
Add next to
List of Values: CustomerId to create an LOV for this item.
Dynamic LOVs are selection lists generated dynamically at runtime based on one or more databound attributes. [ tell me more...]
CustomerName and press Enter.
When you complete the steps for replacing the original
CustomerId input text field on the edit page with the new LOV-enabled
CustomerId attribute, the page in the visual editor should look similar to this: [
tell me more...]
You can run your application in the IDE by right-clicking the
br-o.jspx page and choosing
R
un
from the context menu. [
tell me more...]
ed-o.jspx page.
When you click the
OrderStatusCode choice list on the
ed-o.jspx page, the page in a desktop web browser should look similar to this: [
tell me more...]
Copyright © 1997, 2009, Oracle. All rights reserved.