If your business services supports create operation on the data collection, you can use the operation in a web page to insert a new row. The new row will not be created until the user performs a submit operation on the form. Because the default create operation separates create and insert into two steps, the user can return to the previous page (using the Back button) without displaying a blank, new row.
Note: When you work with ADF Business Components as your business service, you can optionally allow in-place inserts into your components. The CreateInsert operation in the action binding editor is available for this purpose. See below for details.
To create a web page that uses a create operation to insert a row:
Open the Data Control Palette and select the collection node that contains the attributes you want your table to display. This is the collection to which the page will add the row. Do not change the default selection Read-Only Table in the dropdown list.
Note: The data collection you select must not be a detail collection, represented in the data control hierarchy as a child of another collection node. This will ensure that the iterator binding does not perform navigation.
Insert the table into the open web page:
Tip: Optionally, your page can display navigation
buttons to the allow the user to browse the collection.
When you want to work with navigation, the table and navigation buttons must
appear inside a Struts <html:form>
element.
To insert the operation to create the row, select Create in the operations folder for the previously selected collection and select Button with Form from the dropdown list.
Drag the collection from the Data Control Palette into the first column of the read-only table (so it appears above the forEach statement).
To create a commit button and an HTML form to commit the row creation operation, select Commit from the Operations node folder from the top level of the Data Control Palette and select Button with Form in the dropdown list.
Note: The Data Control Palette represents operations (such as Commit and Rollback) that apply to all data collections in the current web page's binding context in a folder at the top of the hierarchy.
Insert the button and HTML form into your web page by dragging the selection from the top portion of the Data Control Palette into the open web page. Insert the HTML form below the table. The design view of the Visual Editor will display the button labeled Commit inside an HTML form represented by a dashed box surrounding the button:
To create the action mapping for the create row page, return to the Struts Page Flow Diagram and complete the following procedure.
To handle the create operation using an insert record form:
Open the page flow diagram and insert a new data page (
/createPage
), and
draw a forward transition between the two.
Create the web page for the new data page and drop the same collection as an Input Form from the Data Control Palette.
Name the page forward transition Create to match the Create operation event name.
Note: Starting in JDeveloper 10.1.2, the Create operation does not insert a new row until the user submits it with the response. Optionally, ADF Business Components allows you to both create and insert the new row when in-place row inserting into a table or tree component is desired. When you want to create and insert as one action, edit the button's action binding in the UI Model and choose CreateInsert . You must also rename the page forward transition to match the CreateInsert operation event name.
Add another page forward transition to return to the browse page and name it Submit to match the input form's Submit button event name.
Limiting Row Fetches Using an ADF Iterator Binding
Copyright © 1997, 2004, Oracle. All rights reserved.