Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to create 'a grid for viewing and a form for editing' in the same page?

A. PENGJul 12 2020 — edited Jul 15 2020

Hi, experts:

In Apex 20.1.

Aims: It will be a common use case that users Browse a grid of records and then select one of them to edit in a form. and all these atctions will be happened in the same page.

Possible Choices:

  1. By useing Create page wizard in APP Builder, I can easily create a grid for viewing records in one page and a form for editing the selected record in another page.

  2. Also there are examples in APP Gallery that a grid for viewing a master tables' records and editing the detail table's record of another grid in the same page.

My tryings:

In the example of Sample Master Detail in App Gallery, there is a Interactive Grid of Milestones in page 17, then I

  1. Create an Item named P17_ID_M to store the selected ID of the Milestones record.

  2. Create a Dynamic action named SelectMilestone to set the value of P17_ID_M.

Execute JavaScript Code for the SelectMilestone Dynamic Actions

var model = this.data.model;

var selectedRecords = this.data.selectedRecords;

if(this.data.selectedRecords.length > 0) {

apex.item( 

"P17_ID_M").setValue(model.getValue(selectedRecords[0], "ID"));

}

  1. Create a Sub Region named MILESTONE 2 with a Form Type based on the same table as the above Milestones.

  2. set the selected id value ( P17_ID_M ) as the filter criteria for the sub region (MILESTONE2) form

see bellowing images:

grid-form 1.png

But these tryings doesn't work!

When records selection changed in the grid, the related form record doesn't showing anything .

grid-form 2.png

What did I missed? and what is the best practice to fullfill my above aim?

Thanks in advance.

This post has been answered by Pavel_p on Jul 13 2020
Jump to Answer
Comments
Post Details
Added on Jul 12 2020
10 comments
1,774 views