简体   繁体   English

Oracle APEX-是否可以在不刷新整个页面的情况下将值提交到会话状态?

[英]Oracle APEX - Is it possible to submit a value to session state without refreshing the entire page?

I've got a page that has a bunch of Select List items. 我有一个页面,其中有一堆“选择列表”项目。 Each Select List item underneath the next executes an SQL query to retrieve the previous item's value from the session state, and displays a new list based on the result. 下一个下面的每个“选择列表”项目都执行一个SQL查询,以从会话状态中检索上一个项目的值,并根据结果显示一个新列表。

I can get everything to work by allowing each Select List item to 'Submit to Page', which refreshes the entire page. 我可以通过允许每个“选择列表”项目“提交到页面”来使所有工作正常进行,这将刷新整个页面。 Seeing as there are 5+ Select List items, it's not very user-friendly to have the user wait on each refresh. 看到有5个以上的“选择列表”项目,让用户等待每次刷新并不是非常用户友好。

Is there a way to either get the value from a Select List into the session state without refreshing the page, or for an SQL Query to take the value from the previous Select List item and use it in it's query to display a new list? 有没有一种方法可以使Select List中的值进入会话状态而无需刷新页面,或者让SQL Query从上一个Select List项目中获取值并在查询中使用它来显示新列表?

I think you are looking for Cascading LOVs. 我认为您正在寻找级联LOV。 Here is a short example on how to use them. 这是有关如何使用它们的简短示例。

Let's say you want to have 2 select lists one with departments and one with the employees that work in the selected department. 假设您要有2个选择列表,一个带有部门,一个带有在选定部门工作的员工。 So we need a table DEPARTMENTS(department_id, deparment_name) with all your departments and a table EMP(emp_id, emp_name, department_id) with all the employees and in what department they work in. 因此,我们需要一个包含所有部门的表DEPARTMENTS(department_id, deparment_name) ,以及一个包含所有雇员及其工作部门的表EMP(emp_id, emp_name, department_id)

Create your first select list named P1_DEPARTMENTS with the List of Values SQL Query like this select department_name, department_id from departments 使用“值列表” SQL查询创建名为P1_DEPARTMENTS第一个选择列表select department_name, department_id from departments P1_DEPARTMENTS

Now create the second select list named P1_EMPLOYEES using the List of Values SQL Query 现在,使用“值列表” SQL查询创建名为P1_EMPLOYEES的第二个选择列表。

select emp_name, emp_id from EMP where department_id=:P1_DEPARTMENTS

Now in the Cascading LOV Parent Item(s) attribute of P1_EMPLOYEES select list you have to select the item that you want to pass as a parent in our case the P1_DEPARTMENTS . 现在,在P1_EMPLOYEES选择列表的级联LOV父项属性中,您必须选择要作为父项传递的项(在本例中为P1_DEPARTMENTS

Now when you select a value in the P1_DEPARTMENTS select list the P1_EMPLOYEES select list will refresh and you will get just the employees that work in the selected department. 现在,当您在P1_DEPARTMENTS选择列表中选择一个值时, P1_EMPLOYEES选择列表将刷新,您将仅获得在所选部门工作的员工。

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

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