0

In order to edit a row in APEX, what is the procedure? I found this link, from 2009 , but it appears to be outdated , because I don't see any pencil & paper icon to the left of the EDIT_LINK columns :

How do you add an edit button to each row in a report in Oracle APEX?

enter image description here

Community
  • 1
  • 1
Caffeinated
  • 11,982
  • 40
  • 122
  • 216
  • 1
    Do you mean a classic report or a dynamic one? Because the dynamic report already has one – Typo Oct 19 '15 at 18:32
  • @Typo - Ok , I see . So I think I'll try using the dynamic one then. I'm guessing it's extra work to use classic report .. thanks ! – Caffeinated Oct 19 '15 at 18:43
  • 1
    it can be done in a classic report too, but it is not as a direct process as with the dynamic report. If you need that I'll answer tomorrow – Typo Oct 19 '15 at 19:27
  • @Typo - I would like that, thanks ! – Caffeinated Oct 19 '15 at 19:55
  • 1
    what version are you using? – brenners1302 Oct 20 '15 at 01:48
  • @brenners1302 the screenshot is the apex 5 ui – Tom Oct 20 '15 at 06:17
  • Ah ok.sorry cant see the screen shot due to restricted access haha.=) – brenners1302 Oct 20 '15 at 06:19
  • 2
    Plus: a good resource for these (default, standard) practices is the sample database application which can be installed from the packaged applications. You can simply glean the setup for these things in there. Furthermore, the two sorts of reports are 'interactive' and 'classic'. Interactive has all the included functionality such as the actions button etc, while a classic is much more maleable. – Tom Oct 20 '15 at 06:27
  • @Tom plus it can exist more than one instance of a classic report on the same page, a limitation of the dynamic report that I cant understand. – Typo Oct 20 '15 at 09:54
  • @Typo in apex 5 you can have multiple interactive reports on a page – Tom Oct 20 '15 at 09:56

1 Answers1

1

1- Create a Classic report with a normal query (including a key column, like empno in this case):

select  empno, 
        name,
        job,
        hiredate
from emp

2- Select the column that will serve as a button:

Column empno

3- Go to Column Formatting -> HTML Expression on the attributes display region: and paste this code:

<button class="t-Button  " id="#EMPNO#" onclick="showRow(#EMPNO#);" type="button"><span class="t-Button-label"> + </span></button>

html wRAP

4- This will generate a button associated to each "empno", notice that I'm setting the id of the button to #EMPNO# (being the value of empno to that row) and I'm setting an onclick call to a javascript function called showRow(empno). In this function is where you'd call either a new page passing the parameters needed or show a modal popup whit the fetched data to beeing modified.

Here's a working example

Typo
  • 1,875
  • 1
  • 19
  • 32
  • Thanks Typo ! I'm working now on figuring how to delete a specific row, when I click the button – Caffeinated Oct 20 '15 at 19:39
  • @Coffee you're wellcome – Typo Oct 20 '15 at 19:48
  • 1
    @Coffee I should have mention it, if you stay on the same page while editing the row you should probably refresh the report once finished the update – Typo Oct 20 '15 at 19:53
  • not sure I follow what you mean there. If I stay on the user-facing APEX page? – Caffeinated Oct 20 '15 at 20:08
  • 1
    @Coffee yes, if you stay on the same page to modify the row (e.g. with a modal popup) once modified,the changes wont be seeing in the report unless it's refreshed (or the page reloaded) – Typo Oct 20 '15 at 20:23