Need a help in understand underline logic here. I have created a simple APEX application. First page shows the table details and via a "Create" button "Interactive Search" region, directs to a form page. Now form page consists of "Save" and "Insert" buttons in correct regions. So whole app works. When I press "Create" from 1st page to 2nd, "Save" button is invisible and when I click the edit icon on the table of 1st page, "Create" button is invisible in 2nd. App works accordingly, but could not figure out what setting enable this set-up even though I was able to make it work. 1st Page : Interactive Report Page. 2nd Page : DML Form. Built the app from blank pages. Could any of you explain how it works?
1 Answers
When you click the Create button on the Interactive Report page, it takes you to the Form page in insert mode, i.e. it allows you to enter a new row into the table. Therefore, the Form page has the Create (and the Cancel) button.
On the other hand, when you click the Edit button on the Interactive Report, it takes you to the same Form page, but this time in edit mode which enables you to modify values (and save those changes with the Apply Changes / Save button), delete that row using the Delete button, or - as previously Cancel current operation.
If you look at Form page's buttons' properties, you'll see that they have Server-side Conditions set which are then used to render (or not) a certain button. For example, if the Form page number is 13 and the primary key column is set to the ID
column, then these conditions look like this:
- Create:
P13_ID IS NULL
(i.e. the primary key column value doesn't exist yet, which means that this is a brand new row) - Apply Chanages / Save:
P13_ID IS NOT NULL
(i.e. the primary key column value exists, which means that row you see was fetched from the database) - Delete:
P13_ID IS NOT NULL
(the same condition as for the Apply Chanages / Save button) - Cancel: it is always displayed.