Reputation: 255
I have a schema with two tables: a parent table and a child table. The parent table has an ID and a varchar column. The child table has an ID, parentID, and varchar column.
I want a page that displays all the varchar's in the parent table as a navigation list. When a link is clicked, it displays a page with a navigation list containing all the child items under that parent id. I'd like to be able to do this for 'n' levels of parent-child, hopefully by defining a total of 'n' pages.
I've successfully created the first list of links on a single page, but I am not sure how to proceed with giving them the appropriate URL to the child page, or how to create a child page that accepts a parameter and uses it in the definition of the subsequent list query.
Upvotes: 0
Views: 2263
Reputation: 1336
In Oracle APEX, every page is defined at design time. This means that the developer chooses how many pages exist while he is developing. What it sounds like you are trying to do, is create pages dynamically, i.e. generate new page numbers on the fly. This is not possible.
However, I do not think that it is necessary to create new pages. It will probably suffice to have a limited number of pages, which simply pass the ID of the record your page is based on as a parameter. If you create a page item on a page, you can set the value of that item by specifying it in the URL you are directing to. You can find more information about APEX URLs here: Understanding URL Syntax.
After you've got that down, you can use the value of the page item on the page you landed on to generate the sub-list by fetching all the child records from the database and creating links for them. To generate the navigation list, I recommend using Lists in your shared components. Go to shared components > Lists > Create > From scratch and then choose to create a dynamic list. In the query you provide here, you can simply reference the page item id (e.g. :P1_RECORD_ID), to get the children of that ID and generate the list items accordingly.
I hope this gets you started. Of course this is just the beginning. If you have any more questions, please expand on your original question.
Upvotes: 1