简体   繁体   English

APEX:提交而不刷新页面

[英]APEX: Submit without refreshing the page

I have an interactive report that runs a large query, which takes about 20 seconds to execute.我有一个运行大型查询的交互式报告,执行大约需要 20 秒。

There are many filter items on the APEX page, which affect the data in the report. APEX页面有很多筛选项,影响报表中的数据。
The report uses a PL/SQL query, which references the items on the page, to pull the data.该报告使用 PL/SQL 查询(引用页面上的项目)来提取数据。

Since most users need to set multiple filters before submitting, I created a Run Report button which submits and refreshes the page, so users don't have to wait 20 seconds multiple times while they set multiple filters.由于大多数用户在提交之前需要设置多个过滤器,我创建了一个Run Report按钮来提交和刷新页面,这样用户在设置多个过滤器时不必多次等待 20 秒。

The problem is, some of the filters are select lists.问题是,一些过滤器是选择列表。
And these select lists are populated based on PL/SQL queries, which pull data from the database, and also reference values in other items on the APEX page as part of the queries.这些选择列表是基于 PL/SQL 查询填充的,这些查询从数据库中提取数据,并作为查询的一部分引用 APEX 页面上其他项目中的值。

So when the user selects an item in one of the select lists, I need to submit the item that was "changed" and then refresh the other filter items on the page, but WITHOUT refreshing the whole page/report.因此,当用户选择其中一个选择列表中的项目时,我需要提交“已更改”的项目,然后刷新页面上的其他过滤器项目,但刷新整个页面/报告。

Ajax should be able to do this, right? Ajax 应该能够做到这一点,对吧?
How do you accomplish this?你如何做到这一点?

I currently have dynamic actions that refresh individual items, and this seems to be working.我目前有刷新单个项目的动态操作,这似乎有效。
But it doesn't pull the correct data from the database to populate the select lists, because it doesn't submit the other filter items first.但它不会从数据库中提取正确的数据来填充选择列表,因为它不会首先提交其他过滤器项。

So when the user selects an item in one of the select lists, I need to submit the item that was "changed" and then refresh the other filter items on the page, but WITHOUT refreshing the whole page/report.因此,当用户选择其中一个选择列表中的项目时,我需要提交“已更改”的项目,然后刷新页面上的其他过滤器项目,但不刷新整个页面/报告。

That should be fairly simple as Select List items, under the "List of values" group of properties, contain Cascade LOV Parent item(s) property.这应该相当简单,因为在“值列表”属性组下的选择列表项包含级联 LOV 父项属性。 It is used for the purpose you described.它用于您描述的目的。

For example, if there were select list items P1_CONTINENT , P1_COUNTRY , P1_CITY , then - when you select a continent, list of countries displays only countries on previously selected continent.例如,如果有选择列表项P1_CONTINENTP1_COUNTRYP1_CITY ,则 - 当您选择一个大洲时,国家/地区列表仅显示先前选择的大洲上的国家/地区。 You'd then put P1_CONTINENT into P1_COUNTRY list item's "Cascading LOV Parent item(s)" and that's all.然后,您将P1_CONTINENT放入P1_COUNTRY列表项的“级联 LOV 父项”中,仅此P1_COUNTRY

A lot of a APEX page uses AJAX to refresh parts of the page.许多 APEX 页面使用 AJAX 来刷新页面的某些部分。 So it's there already :) Anyway, for select lists you can use the "Cascading LOV Parent Item(s)" in order to let that select lists refresh whenever other items change their values.所以它已经存在了 :) 无论如何,对于选择列表,您可以使用“级联 LOV 父项”,以便在其他项更改其值时让该选择列表刷新。 For other item which does not have the "Cascading LOV Parent Item(s)", you need to submit the values to the session, before you can use them in some sql.对于没有“Cascading LOV Parent Item(s)”的其他项目,您需要将值提交给会话,然后才能在某些 sql 中使用它们。 You can create a dynamic action on the items that changes value, do a pl/sql expression just as a dummy您可以在更改值的项目上创建动态操作,就像虚拟对象一样执行 pl/sql 表达式

null;

and submit the items value to the session and then do a refresh of the items that needs to be refreshed...并将items值提交给session,然后对需要刷新的items进行刷新...

Hope it helps :) and happy APEXing希望它有帮助:) 和快乐的 APEXing

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM