9 total views, 5 views today
ADF delete row programmatically
In this section, I have explained deleting a record from an ADF table programmatically. I have used the Country table in HR schema for this example.
ADF delete row programmatically – Started
In my ADF model project, I have created EO and VO of the country table. The following methods in the AppModuleimpl java class will delete the selected row and first record
removeCurrentRow() => removes the record the user is viewing at the time .
removeFirstRow() => Removes first record in the table
Expose this method
We need to expose this method to make it available for UI. The below step is doing the same.
Double click on the AppModule.xml file >> Click Java >> Click the pencil icon >> Drag that method to the selected column as shown below & click Ok
1. Right click the APpModule.xml and click Run
2. An appmodule wizard appears on the screen. Double click on the CountryEOView1 object. You will get the Argentina as the record loaded on the screen similar to below
3. Double click on the AppModule >> Select removeCurrentRow() >> click execute . The Argentina is the current record you are viewing got deleted.
4. To check this, double click the CounryEOView1 again, you will see Australia is loaded and no more Argentina
Double click on the AppModule >> Select method removeFirstRow >> Click Execute. You will get the below error pop up saying about the foreign key violation because the record has been used by some other table.
The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.
Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
Latest posts by Govind
- JSF Login Logout Form Authentication Example - October 16, 2017
- How to Bookmark URL in JSF using GET method and ViewParam – example - October 14, 2017
- JSF Dynamic Navigation and how to use wildcard in navigation - October 12, 2017