I'm going to post a series of articles about CRUD functionality (on top of ADF BC) implementation in JET. I already had a couple of posts
about JET CRUD implementation, this new series will bring improved and simplified structure for JET code implementation.
Today I will start with explanation and example how to pass selected object ID from search screen into edit screen. I have uploaded complete sample (with ADF BC and JET) into GitHub repository. Download ready to be run code or browse it directly from GitHub repository
There are two essential parts to understand, when you implement search/edit form.
1. How to get selected object ID
I have implemented read-only table where user could select a record and navigate to edit form. JET table is enhanced with template. Each row renders edit action link. When this link is pressed, it calls our custom editCustomer
function and also it sends across a key value from selected row (EmployeeId):
function we can access key parameter value and store it into JET router (this will make it accessible from another JET module, where we navigate for editing - editCustomer):
2. How to use selected object ID for edit
Edit module contains initialize
function. It gets invoked automatically, each time we navigate to edit screen. Inside this function we can can access and retrieve parameter value stored in JET router. It can be used to fetch data model for editing:
This is how it looks like. User can select a row in JET table (enabled with pagination) and click on edit action:
Edit module will be loaded and data will be fetched for editing by key passed through JET router: