APEX:如何实现循环级联选择列表(多对多) [英] APEX: How to implement circular cascade select-lists (many-to-many)

查看:73
本文介绍了APEX:如何实现循环级联选择列表(多对多)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在处理多对多关系时,如何为选择列表实现循环级联逻辑?

When dealing with many-to-many relationships, how do you implement circular cascade logic for select-lists?

例如,我创建了一个简单的测试应用来跟踪书籍和作者.
(这比我实际的业务场景要简单得多,也更清楚地说明了问题.)

As an example, I created a simple test app that tracks books and authors.
(This is way simpler than my actual business scenario, and it shows the issue more clearly.)

主页包含:

  • 提交页面的按钮
  • 书籍选择列表
  • 作者选择列表

我使用提交按钮是因为我的实际业务场景包括一个很长的报告,需要 20-60 秒来刷新 - 并且有十几个选择列表供用户选择,之前提交页面并提取报告.

I'm using a submit button because my real-world business scenario includes a very lengthy report, which takes 20-60 seconds to refresh - and there are a dozen select-lists that the user needs to choose from, BEFORE submitting the page and pulling the report.

这是一个包含我正在处理的所有测试数据的完整脚本:

CREATE table "BOOK" (
    "ID"         INTEGER GENERATED ALWAYS AS IDENTITY NOT NULL ENABLE,
    "TITLE"      VARCHAR2(100) NOT NULL ENABLE,
    constraint  "BOOK_CK" check ("TITLE"<>''),
    constraint  "BOOK_PK" primary key ("ID"),
    constraint  "BOOK_UK1" unique ("TITLE")
)
/

CREATE table "AUTHOR" (
    "ID"         INTEGER GENERATED ALWAYS AS IDENTITY NOT NULL ENABLE,
    "NAME"       VARCHAR2(100) NOT NULL ENABLE,
    constraint  "AUTHOR_CK" check ("NAME"<>''),
    constraint  "AUTHOR_PK" primary key ("ID"),
    constraint  "AUTHOR_UK1" unique ("NAME")
)
/

INSERT INTO BOOK (TITLE) VALUES ('BOOK01');
INSERT INTO BOOK (TITLE) VALUES ('BOOK02');
INSERT INTO BOOK (TITLE) VALUES ('BOOK03');
INSERT INTO BOOK (TITLE) VALUES ('BOOK04');
INSERT INTO BOOK (TITLE) VALUES ('BOOK05');
INSERT INTO BOOK (TITLE) VALUES ('BOOK06');
INSERT INTO BOOK (TITLE) VALUES ('BOOK07');
INSERT INTO BOOK (TITLE) VALUES ('BOOK08');
INSERT INTO BOOK (TITLE) VALUES ('BOOK09');
INSERT INTO BOOK (TITLE) VALUES ('BOOK10');
INSERT INTO BOOK (TITLE) VALUES ('BOOK11');
INSERT INTO BOOK (TITLE) VALUES ('BOOK12');
INSERT INTO BOOK (TITLE) VALUES ('BOOK13');
INSERT INTO BOOK (TITLE) VALUES ('BOOK14');
INSERT INTO BOOK (TITLE) VALUES ('BOOK15');
INSERT INTO BOOK (TITLE) VALUES ('BOOK16');
INSERT INTO BOOK (TITLE) VALUES ('BOOK17');
INSERT INTO BOOK (TITLE) VALUES ('BOOK18');
INSERT INTO BOOK (TITLE) VALUES ('BOOK19');
INSERT INTO BOOK (TITLE) VALUES ('BOOK20');

INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR01');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR02');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR03');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR04');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR05');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR06');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR07');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR08');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR09');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR10');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR11');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR12');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR13');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR14');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR15');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR16');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR17');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR18');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR19');
INSERT INTO AUTHOR (NAME) VALUES ('AUTHOR20');

CREATE table "BOOK_AUTHOR" (
    "ID"         INTEGER GENERATED ALWAYS AS IDENTITY NOT NULL ENABLE,
    "BOOK_ID"    INTEGER NOT NULL ENABLE,
    "AUTHOR_ID"  INTEGER NOT NULL ENABLE,
    constraint  "BOOK_AUTHOR_PK" primary key ("ID"),
    constraint  "BOOK_AUTHOR_UK1" unique ("BOOK_ID","AUTHOR_ID")
)
/

ALTER TABLE BOOK_AUTHOR ADD FOREIGN KEY (BOOK_ID)
      REFERENCES BOOK (ID) ENABLE
/

ALTER TABLE BOOK_AUTHOR ADD FOREIGN KEY (AUTHOR_ID)
      REFERENCES AUTHOR (ID) ENABLE
/

CREATE OR REPLACE VIEW "VW_BOOK_AUTHOR" AS
SELECT ba.ID,
       ba.BOOK_ID,
       b.TITLE BOOK_TITLE,
       ba.AUTHOR_ID,
       a.NAME AUTHOR_NAME
FROM BOOK_AUTHOR ba
LEFT JOIN BOOK b on b.ID = ba.BOOK_ID
LEFT JOIN AUTHOR a on a.ID = ba.AUTHOR_ID
/

INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK01' AND a.NAME='AUTHOR01';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK02' AND a.NAME='AUTHOR02';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK03' AND a.NAME='AUTHOR03';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK04' AND a.NAME='AUTHOR04';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK05' AND a.NAME='AUTHOR05';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK06' AND a.NAME='AUTHOR06';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK07' AND a.NAME='AUTHOR07';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK08' AND a.NAME='AUTHOR08';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK09' AND a.NAME='AUTHOR09';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK10' AND a.NAME='AUTHOR10';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK11' AND a.NAME='AUTHOR11';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK12' AND a.NAME='AUTHOR12';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK13' AND a.NAME='AUTHOR13';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK14' AND a.NAME='AUTHOR14';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK15' AND a.NAME='AUTHOR15';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK16' AND a.NAME='AUTHOR16';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK17' AND a.NAME='AUTHOR17';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK18' AND a.NAME='AUTHOR18';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK19' AND a.NAME='AUTHOR19';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK20' AND a.NAME='AUTHOR20';

INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK02' AND a.NAME='AUTHOR01';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK02' AND a.NAME='AUTHOR03';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK04' AND a.NAME='AUTHOR03';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK04' AND a.NAME='AUTHOR05';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK06' AND a.NAME='AUTHOR05';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK06' AND a.NAME='AUTHOR07';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK08' AND a.NAME='AUTHOR07';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK08' AND a.NAME='AUTHOR09';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK10' AND a.NAME='AUTHOR09';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK10' AND a.NAME='AUTHOR11';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK12' AND a.NAME='AUTHOR11';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK12' AND a.NAME='AUTHOR13';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK14' AND a.NAME='AUTHOR13';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK14' AND a.NAME='AUTHOR15';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK16' AND a.NAME='AUTHOR15';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK16' AND a.NAME='AUTHOR17';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK18' AND a.NAME='AUTHOR17';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK18' AND a.NAME='AUTHOR19';
INSERT INTO BOOK_AUTHOR (BOOK_ID,AUTHOR_ID) SELECT b.ID, a.ID FROM BOOK b, AUTHOR a WHERE b.TITLE='BOOK20' AND a.NAME='AUTHOR19';

此时,如果您选择一本书,然后单击按钮提交页面,则作者列表将缩小到仅所选书籍的作者.(如果您选择作者,则反之亦然.)

At this point, if you select a book, and then click the button to submit the page, the authors list is narrowed down to only authors of the selected book. (And vice-versa if you select an author.)

下一步,我需要刷新选择列表无需提交和刷新整个页面.

For the next step, I need to refresh the select lists WITHOUT submitting and refreshing the entire page.

让我们首先将级联设置添加到 ONE 选择列表 (P1_AUTHOR):

Let's start by adding cascade settings to just ONE of the select-lists (P1_AUTHOR):

到目前为止一切顺利.
现在,当用户选择一本书时,作者选择列表会自动刷新.

So far so good.
Now the author select-list automatically refreshes, when the user selects a book.

但是,当我们还为其他选择列表配置级联设置时,我们遇到了问题:

However, we run into problems when we also configure cascade settings for the other select-list:

现在,当我们运行页面并尝试选择一本书或作者时,页面崩溃并出现 Javascript 异常:

Now, when we run the page, and try to select a book OR author, the page crashes with a Javascript exception:

错误是Maximum call stack size exceeded,表示无限循环执行(带递归).

The error is Maximum call stack size exceeded, which indicates an infinite loop execution (with recursion).

这看起来可能是 APEX 代码中的一个错误/疏忽,因为技术情况可以通过正确/稳健的逻辑轻松解决.

This seems like it COULD be a bug/oversight in the APEX code, since the technical situation is easily resolvable with correct/robust logic.

也就是说,我该如何解决这个问题?
是否有不同的方式来配置级联选项以使其工作?
或者我可以编写自定义动态操作和 Javascript 来手动提交单个项目,并手动刷新选择列表?

That said, how can I work around this?
Is there a different way of configuring the cascade options to make this work?
Or can I write custom dynamic actions and Javascript to manually submit individual items, and manually refresh the select-lists?

推荐答案

首先,我只想说,提问的方式!:)

First of all, I just want to say, way to ask a question! :)

如您所见,级联"部分旨在从父级流向子级,而不是循环流动(这可能导致堆栈溢出!抱歉,无法抗拒).

As you've found, the "cascading" part is meant to flow from parent to child, not circularly (which can lead to a Stack Overflow! Sorry, couldn't resist).

我会给你一个解决方案,但我会预先承认这是次优的,因为选择列表的每次更改都需要两次 Ajax 调用,而不仅仅是一次.我会向 APEX 团队提出这个问题,希望他们能在未来解决这个问题.

I'll give you a solution, but I'll admit up front that it's sub-optimal in that each change of a select list will require two Ajax calls rather than just one. I'll raise the issue with the APEX team in hopes that they can address it in the future.

假设人们已经运行了您的脚本并且有一个带有 HTML 区域的空白页面,我将开始这些步骤.我的页面是 53,所以人们需要相应地进行更改.

I'll start the steps assuming that folks have run your script and have a blank page with an HTML region. My page was 53, so folks will need to make changes accordingly.

第 1 部分:基础知识

  1. 向区域添加页面项.将名称设置为P53_BOOK,将类型设置为选择列表,并将值列表类型> 到 SQL 查询.在 SQL 查询 字段中输入以下代码:

  1. Add a page item to the region. Set Name to P53_BOOK, Type to Select List, and the List of Values Type to SQL Query. Enter the following code in the SQL Query field:

select title d,
  id r
from book
where (
  :P53_AUTHOR is null
    or id in (
      select book_id
      from book_author
      where author_id = :P53_AUTHOR
    )
)
order by title

  • 向该区域添加另一个项目.将名称设置为P53_AUTHOR,将类型设置为选择列表,并将值列表类型设置为> 到 SQL 查询.在 SQL 查询 字段中输入以下代码:

  • Add another item to the region. Set Name to P53_AUTHOR, Type to Select List, and the List of Values Type to SQL Query. Enter the following code in the SQL Query field:

    select name d,
      id r
    from author
    where (
      :P53_BOOK is null
        or id in (
          select author_id
          from book_author
          where book_id = :P53_BOOK
        )
    )
    order by name
    

  • 在页面设计器的渲染窗格中,右键单击P53_BOOK,选择创建动态操作,然后设置其名称P53_BOOK 已更改.将客户端条件 类型 设置为 JavaScript 表达式,然后在 JavaScript 表达式 字段中输入以下代码:

  • In the Rendering pane of the Page Designer, right-click P53_BOOK, select Create Dynamic Action, and then set its Name to P53_BOOK changed. Set the Client-side Condition Type to JavaScript Expression and enter the following code in the JavaScript Expression field:

    this.browserEvent.originalEvent !== undefined
    

    虽然看起来很奇怪,但这会阻止动态操作在刷新其他项目时触发(防止出现不同的循环逻辑问题;请参阅 详情).

    While it looks odd, this will prevent the Dynamic Action from firing when the other item is refreshed (prevents a different circular logic issue; see this for details).

    在操作级别,将操作显示更改为执行PL/SQL代码.将 PL/SQL 代码 设置为 null; 并将 要提交的项目 设置为 P53_BOOK.此操作仅用于在您接下来创建的刷新操作之前更新 P53_BOOK 的会话状态.

    At the action level, change the Action from Show to Execute PL/SQL Code. Set PL/SQL Code to null; and Items to Submit to P53_BOOK. This action is only being used to update session state for P53_BOOK prior to the refresh action you'll create next.

    右键单击P53_AUTHOR,选择创建动态操作,然后将其名称设置为P53_AUTHOR已更改强>.将客户端条件 类型 设置为 JavaScript 表达式,然后在 JavaScript 表达式 字段中输入以下代码:

    Right-click P53_AUTHOR, select Create Dynamic Action, and then set its Name to P53_AUTHOR changed. Set the Client-side Condition Type to JavaScript Expression and enter the following code in the JavaScript Expression field:

    this.browserEvent.originalEvent !== undefined
    

  • 在操作级别,将操作更改为执行 PL/SQL 代码.将 PL/SQL 代码 设置为 null;,将 要提交的项目 设置为 P53_AUTHOR.

  • At the action level, change the Action to Execute PL/SQL Code. Set PL/SQL Code to null; and Items to Submit to P53_AUTHOR.

    如果你运行它,它应该会按预期工作(在大多数情况下).最大的问题是,如果您对一项进行更改并刷新另一项,则另一项中的选择将始终丢失 - 即使刷新后该项中存在预刷新值.

    If you run that, it should work as expected (for the most part). The biggest problem is that if you make a change to one item and it refreshes the other item, the selection in the other item will always be lost - even if the pre-refresh value exists in the item after the refresh.

    以下步骤可用于自动重新选择可用的值.

    The following steps can be used to automatically reselect the value if it's available.

    第 2 部分:恢复先前选择的值(可选)

    1. 转到P53_BOOK 已更改 动态操作.添加一个在前两个操作之前触发的新真实操作.将操作设置为执行JavaScript代码并在代码字段中输入以下代码:

    1. Go to the P53_BOOK changed Dynamic Action. Add a new true action that fires before the previous two actions. Set Action to Execute JavaScript Code and enter the following code in the Code field:

    $('#P53_BOOK').data('last-val', $v('P53_BOOK'));
    

    该代码使用 jQuery 的 data 方法来存储项目预刷新的值.稍后您将在刷新后使用它.

    That code uses jQuery's data method to store the value of the item pre-refresh. You'll use it later after the refresh.

    转到P53_AUTHOR已更改动态操作.添加一个在前两个操作之前触发的新真实操作.将操作设置为执行JavaScript代码并在代码字段中输入以下代码:

    Go to the P53_AUTHOR changed Dynamic Action. Add a new true action that fires before the previous two actions. Set Action to Execute JavaScript Code and enter the following code in the Code field:

    $('#P53_AUTHOR').data('last-val', $v('P53_AUTHOR'));
    

  • 右键单击P53_BOOK,然后选择创建动态操作.将名称设置为P53_BOOK refreshed并将Event设置为After Refresh.

  • Right-click P53_BOOK and select Create Dynamic Action. Set Name to P53_BOOK refreshed and set Event to After Refresh.

    在操作级别,将操作设置为执行 JavaScript 代码,然后在代码字段中输入以下内容:

    At the action level, set Action to Execute JavaScript Code and enter the following in the Code field:

    $s('P53_BOOK', $('#P53_BOOK').data('last-val'), null, true);
    

    该代码使用 data 方法(这次作为 getter)设置 P53_BOOK 的值.$s (true) 的最后一个参数被传递以抑制更改事件,否则会创建更多循环逻辑.

    That code sets the value of P53_BOOK using the data method (this time as a getter). The last parameter to $s (true) is passed to suppres the change event, which would otherwise create more circular logic.

    在操作级别,将操作设置为执行 JavaScript 代码,然后在代码字段中输入以下内容:

    At the action level, set Action to Execute JavaScript Code and enter the following in the Code field:

    $s('P53_AUTHOR', $('#P53_AUTHOR').data('last-val'), null, true);
    

  • 应该可以.但是还有一件更烦人的事情......如果您在任一字段中选择一个空值,您可能希望它刷新两个字段(显示两个字段的所有选项),但它不会像那样工作.如果需要,我建议只添加一个单独的重置按钮.否则,您可能最好用原始 JavaScript 代码编写所有这些内容.

    That should do it. But there's one more annoying thing left... If you select a null value in either field, you might expect it to refresh both fields (showing all the options for both), but it doesn't work like that. If this is desired, I'd recommend just adding a separate reset button instead. Otherwise, you'd probably be best off writing all of this in raw JavaScript code.

    这篇关于APEX:如何实现循环级联选择列表(多对多)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆