简体   繁体   English

根据另一个文本框中的数据在Oracle Apex中填充LOV

[英]Filling a LOV in Oracle Apex based on data in another text box

I am fairly new to Oracle Apex, and have a problem. 我对Oracle Apex相当陌生,并且有问题。 Our application currently has a method of entering data, with several text boxes and Optional List of Values. 我们的应用程序当前具有一种输入数据的方法,其中包含多个文本框和“可选值列表”。 I would like to have an LOV based on information in another text box like so: 我想基于另一个文本框中的信息创建LOV,如下所示:

select APPOINTMENT_ID PATIENT_ID from APPOINTMENT where PATIENT_ID = :P9_PAT_NUM

where P9_PAT_NUM is a patient number in a text box. 其中P9_PAT_NUM是文本框中的患者编号。 However, this would apparently only work if the text box has already been submitted, else it assumes the text box is null. 但是,这显然仅在文本框已提交的情况下才有效,否则它将假定该文本框为空。

Is there any way to get this working with an LOV, or perhaps some other method? 有没有什么方法可以使它与LOV一起使用,或者还有其他方法?

In Apex version 4+ this is a built-in feature. 在Apex 4+版本中,这是一个内置功能。 You simply specify the item that the LOV depends on in the Cascading LOV Parent Item(s) property. 您只需在级联LOV父项属性中指定LOV依赖的

Prior to version 4, there are a number of solutions available - Google "Apex cascading LOV" and you'll find a few solutions that involve a bit of work, eg: 在版本4之前,有许多解决方案可用-Google“ Apex级联LOV”,您会发现一些涉及一些工作的解决方案,例如:

Javascript: http://www.inside-oracle-apex.com/generic-solution-for-cascading-select-listslovs/ Javascript: http//www.inside-oracle-apex.com/generic-solution-for-cascading-select-listslovs/

ApexLib: http://one-size-doesnt-fit-all.blogspot.com/2007/10/apex-cascading-lovs-revisited.html ApexLib: http ://one-size-doesnt-fit-all.blogspot.com/2007/10/apex-cascading-lovs-revisited.html

Using ExtJS: http://application-express-blog.e-dba.com/?tag=apex-cascading-lov 使用ExtJS: http ://application-express-blog.e-dba.com/ tag = apex-cascading-lov

Once Apex 4.0 comes out (should be quite soon) this will be very simple using its cascading LOV functionality. 一旦Apex 4.0推出(应该很快),使用其级联LOV功能将非常简单。 Prior to that you can do it in one of two ways: easy but clunky, or difficult but slick... 在此之前,您可以通过以下两种方式之一进行操作:简单但笨拙,或者困难但光滑...

1) Easy but clunky: 1)简单但笨拙:

Add the following Javascript to the first item's HTML form element attributes: 将以下Javascript添加到第一项的HTML表单元素属性中:

onchange="doSubmit()"

This will submit the page when the first item is changed, so when it reloads the item's current value will have been used to populate the LOV. 当第一个项目更改时,这将提交页面,因此在重新加载该项目时,将使用该项目的当前值来填充LOV。 I say is it "clunky" because the entire page reloads (slow), and the cursor moves back to the starting position. 我说这是“笨拙的”是因为整个页面重新加载(慢),并且光标移回了起始位置。

2) Difficult but slick: 2)困难但光滑:

If your LOV is a popup then you just need to get the value of the first item into session state, which you can do via Javascript and AJAX. 如果您的LOV是一个弹出窗口,则只需要使第一项的值进入会话状态即可,这可以通过Javascript和AJAX进行。

If your LOV is a select list then you need to dynamically re-populate the select list using Javascript and AJAX. 如果您的LOV是选择列表,则需要使用Javascript和AJAX动态重新填充选择列表。

I won't got into the details of these, but I see that while I've been writing this Jeffrey Kemp has posted some useful links that will explain in more detail. 我不会详细介绍这些内容,但是我看到在撰写本文时,Jeffrey Kemp发布了一些有用的链接,这些链接将进行详细说明。

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

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