I’ve been working on an application that utilizes a selector on one of my pages. Currently it has 5 tabs – 2 that are based on tables and are available for edit, 2 that contain virtual columns based on table data and one that is based on a view. While creating one of my tabs, I ran into an issue where I wanted to update a row…but there wasn’t an option to do so with the page constraints (and, granted, I’m a newbie so there could definitely be a better way!). So I sought to figure out how to add an option to edit a row of data that was based on one of my tables and I got it! …After quite a bit of frustration and time. Hopefully this blog will help you get to the finish line quicker than I did.
- Add the new sub-region to the Selector region of the page. Right-click on “Selector” and click “Create Sub Region”.
- I want to use a Tabular Form, so that’s what I chose from the drop down list. Give the region a name and SQL to pull data from noting that the first column selected is -> ‘ ‘ edit_link
- Under my new sub-region’s columns, click on “EDIT_LINK”
- Under Identification, choose “Link” as the Type.
- Under “Link” -> “Target”, click on “No Link Defined”
- This will show the “Link Builder – Target” window
- Under “Type”, choose “Page in this application” which is the page you are using to create and/or update rows.
- Choose the page you want to link to.
- Now this next section is key to setting up your data to be prepopulated on your linked form. This is where you are going to link together the columns between what is shown on this report versus what is on the page you are linking to. If I demo first with ID, I will choose “ID” from the current page’s list of options.
Next, I will choose “ID” from the target page’s set of columns.
The screen will show the links between my two pages. I’ll continue doing this until all items are linked together.
- Click OK and you are done with linking the columns.
- Next, you’ll need either text or an icon to show that a row can be edited. I, personally, like the standard pencil. Click the list next to “Link Text” and choose “apex-edit-pencil.png”. The slot will populate with some code that will show a picture upon running of the form.
- You are done! If you run the page, you will see that the edit icon now shows.
- If you click one of the rows, you will be taken to the form where it will be prepopulate with data and the “Update” button will show recognizing that it’s not a new record.
- **Note that I also linked in my primary and foreign keys to make updating possible from this form even though they can’t been seen on the form itself.