Pages

Sunday, May 6, 2012

Use case of SelectManyListBox component

Oracle ADF is a powerful application framework for building next generation enterprise applications. This blog discusses one interesting use case scenario and solutions using ADF.

The selectManyListbox component creates a component which allows the user to select many values from a list of items. SelectManyListBox.

Use-Case:
The selected values of a SelectManyListBox component has to persist in the corresponding columns of a database table and the saved values should be shown as selected in SelectManyListBox for a particular record.

Say, the SelectManyListBox component displays the days of a week e.g. Monday, Tuesday, Wednesday, so on. For each value(Monday, Tuesday etc.) there is a corresponding column(Mon, Tue etc) in a db table. If the value Monday is selected, Y is inserted in the Mon column of db table, otherwise N is inserted and so on.

And when SelectManyListBox is displayed on the UI page, the days of the week are selected for the respective columns(Mon, Tue etc) having value equal to for a particular record. Moreover, on unselecting the values, N is persisted in the corresponding columns.

Data Model:


UI:


Steps implemented are:
1. Create a Fusion Web Application.
2. Create all the required Business Components (EO, VO, AM) for the above data model.
3. Drag and drop the VO as a form layout.
4. Drag a SelectManyListBox UI Component and bind it with a data source(static or dynamic) as shown below.


5. Bind the value property of SelectManyListBox to a managed bean property, which evaluates the values to be displayed as selected.


6. When any value is selected on the UI, it is saved as Y in the corresponding column and vice versa.


Sample Workspace:
Download the sample workspace from here.

No comments:

Post a Comment