Sie sind auf Seite 1von 7

CRUD Operations in JDeveloper/ADF 11g R1 PS1 Table Component

While working on the customer side during last week, we have discussed a use case where user works with read-only only tables and performs data editing through inline popup. In ADF 11g you can use clickToEdit editing mode for a table component in order to improve impro rendering performance. With this mode table will be rendered as read-only, read only, but user will be able to edit rows by double clicking on current row. However this case was not suitable for the client, they wanted to edit and insert new rows in inline popup, mainly because there will be additional editable columns. We have tried to implement this requirement in JDeveloper/ADF 11g R1, using af:popup component, but it was not working for insert mode. Same week we got new Oracle JDeveloper release - JDeveloper 11g 11 R1 PS1, and new functionality that allows to open ADF Task Flows as inline popups (read Frank Nimphius blog post - JDeveloper 11g R1 PS1 New Feature: Launching DHTML popup dialogs using the external dialog framework). framework). In this blog post I will describe how you can enable CRUD operations in table component using ADF Faces external dialog framework. Download sample application with implemented CRUD functionality TableDialogEdit.zip. . This sample provides a table component, with implemented Insert, Edit, Save, Delete and Undo functionality:

Table is read-only, Insert and Edit operations will be performed through inline dialog. User can select a row and by pressing Edit, will open a dialog to edit data:

When user will press Close button inside inline dialog, Dialog Return Listener method will be invoked to refresh parent table, see code in managed bean. Data in parent table is refreshed, user can commit his changes by pressing Save button or revert by pressing Undo:

In similar way, user can create new row by pressing Insert, blank row will be opened in inline dialog:

User can insert data, and close inline dialog with Close button:

Previously inserted blank row will be refreshed with entered data, same as in editing case user er can commit or revert it:

I have implemented this functionality based on information from Frank Nimphius blog mentioned above. From main page located in ADF Unbounded Task Flow, I'm calling ADF Bounded Task Flow where editing JSPX page is implemented. If Insert button was pressed, before calling ADF Bounded Task Flow, CreateInsert operation Method Call is invoked:

Call for ADF Bounded Task Flow is defined to run as dialog and to be displayed as inline popup:

This allows us to open standard ADF Bounded Task Flow as inline dialog:

On the main page, table panel collection contains five buttons, two of them - Insert and Edit are opening inline dialog for data editing:

Those two buttons should be configured to open inline dialog, by setting UseWindow, WindowEmbedStyle and WindowModalityType properties accordingly:

Posted by Andrejus Baranovskis at 9:01 AM

Das könnte Ihnen auch gefallen