如何在 Oracle APEX 中为报表中的每一行添加编辑按钮?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1075550/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 01:59:30  来源:igfitidea点击:

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

oraclereporteditoracle-apexregion

提问by Corrine

I'm using Oracle APEX and I have a report region in a page that displays columns from a SQL query. I want to add edit buttons to the first column of this report so that the user can click on it and edit/review one of the results. How do I add this edit button? Thanks.

我正在使用 Oracle APEX,并且在显示 SQL 查询列的页面中有一个报告区域。我想将编辑按钮添加到此报告的第一列,以便用户可以单击它并编辑/查看其中一个结果。如何添加此编辑按钮?谢谢。

回答by Tony Andrews

  1. Add a column to the SELECT statement of the report like this:

    SELECT '' edit_link, -- This is the new column
        ...
    
  2. Go to the Report Attributes tab.

  3. Move the new column EDIT_LINK to the top of the list of columns (if you want it to be first).

  4. Click on the pencil and paper icon to the left of the EDIT_LINK alias to open the Column Attributes page.

  5. Go to the Column Link section of the Column Attributes page.

  6. Pick one of the icons shown as [Icon 1], [Icon 2], ... (alternatively you can use one of your own but that is more advanced).

  7. Fill out the remaining Link fields to specify which page of your application you want to go to when the link is pressed and what values you will be passing in. Lists of values are supplied to help with this. For example, you might specify:

    • Page: 42
    • Item 1 Name: P42_EMPNO
    • Item 1 Value: #EMPNO#

      (This would navigate to page 42, setting page item P42_EMPNO to the value of EMPNO in the current report row.)

  8. Press the Apply Changes button.

  1. 在报表的 SELECT 语句中添加一列,如下所示:

    SELECT '' edit_link, -- This is the new column
        ...
    
  2. 转至报告属性选项卡。

  3. 将新列 EDIT_LINK 移至列列表的顶部(如果您希望将其放在首位)。

  4. 单击 EDIT_LINK 别名左侧的铅笔和纸图标以打开“列属性”页面。

  5. 转到“列属性”页面的“列链接”部分。

  6. 选择显示为 [Icon 1]、[Icon 2]、... 的图标之一(或者,您可以使用自己的一个,但更高级)。

  7. 填写剩余的链接字段以指定按下链接时要转到应用程序的哪个页面以及将传入的值。提供的值列表可帮助解决此问题。例如,您可以指定:

    • 页数:42
    • 项目 1 名称:P42_EMPNO
    • 项目 1 值:#EMPNO#

      (这将导航到第 42 页,将页面项目 P42_EMPNO 设置为当前报告行中的 EMPNO 值。)

  8. 按应用更改按钮。

Now run the page and you will have an edit link for each row.

现在运行该页面,您将拥有每一行的编辑链接。

回答by Jeffrey Kemp

You can use the Column Link section (as per Tony Andrews' answer) on any column in the report to add links. e.g. "Emp Name" might link to the employee details, "Dept Name" might link to the details for the department, etc.

您可以使用报告中任何列上的“列链接”部分(根据 Tony Andrews 的回答)来添加链接。例如,“Emp Name”可能链接到员工详细信息,“Dept Name”可能链接到部门的详细信息等。