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):
Inside editCustomer 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:
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):
Inside editCustomer 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:
2 comments:
Hi Andrejus,
First of all you are posts are too informative and has helped me a lot.
I often used to just pick your sample and get my issues solved. However i am not able to download those sample codes anymore. Since you explain it as per your sampleApp, those examples come in too handy.
for Example: http://andrejusb.blogspot.in/2009/08/web-service-interface-for-adf-bc.html
I am not able to download the sample in this place. Have you moved this code somewhere else or is it possible to retrieve it.
Thanks,
Abhishek
You can download all old sample (prior to 2014) from Google Archive directory - https://code.google.com/archive/p/jdevsamples/downloads
Andrejus
Post a Comment