根据另一个文本框中的数据在 Oracle Apex 中填充 LOV
我对 Oracle Apex 相当陌生,并且遇到了问题。我们的应用程序当前有一种输入数据的方法,带有多个文本框和可选值列表。我想要一个基于另一个文本框中的信息的 LOV,如下所示:
select APPOINTMENT_ID PATIENT_ID from APPOINTMENT where PATIENT_ID = :P9_PAT_NUM
其中 P9_PAT_NUM 是文本框中的患者编号。然而,这显然只有在文本框已经提交的情况下才有效,否则它假设文本框为空。
有什么方法可以让它与 LOV 或其他方法一起工作吗?
I am fairly new to Oracle Apex, and have a problem. 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:
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. 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Apex 版本 4+ 中,这是一项内置功能。您只需在级联 LOV 父项属性中指定 LOV 所依赖的项即可。
在版本 4 之前,有许多可用的解决方案 - Google“Apex cascading LOV”,您会发现一些涉及一些工作的解决方案,例如:
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
使用 ExtJS:
http://application-express-blog.e-dba .com/?tag=apex-cascading-lov
In Apex version 4+ this is a built-in feature. You simply specify the item that the LOV depends on in the Cascading LOV Parent Item(s) property.
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, e.g.:
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
Using ExtJS:
http://application-express-blog.e-dba.com/?tag=apex-cascading-lov
一旦 Apex 4.0 发布(应该很快),使用其级联 LOV 功能将变得非常简单。在此之前,您可以通过以下两种方式之一完成此操作:简单但笨重,或困难但巧妙...
1) 简单但笨重:
将以下 Javascript 添加到第一项的 HTML 表单元素属性中:
这将在以下情况下提交页面:第一个项目已更改,因此当它重新加载时,该项目的当前值将用于填充 LOV。我说它“笨重”是因为整个页面重新加载(缓慢),并且光标移回起始位置。
2) 困难但灵活:
如果您的 LOV 是弹出窗口,那么您只需将第一项的值获取到会话状态,这可以通过 Javascript 和 AJAX 来完成。
如果您的 LOV 是一个选择列表,那么您需要使用 Javascript 和 AJAX 动态重新填充选择列表。
我不会详细介绍这些内容,但我看到在我撰写本文时,杰弗里·坎普发布了一些有用的链接,这些链接将进行更详细的解释。
Once Apex 4.0 comes out (should be quite soon) this will be very simple using its cascading LOV functionality. Prior to that you can do it in one of two ways: easy but clunky, or difficult but slick...
1) Easy but clunky:
Add the following Javascript to the first item's HTML form element attributes:
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. I say is it "clunky" because the entire page reloads (slow), and the cursor moves back to the starting position.
2) Difficult but slick:
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.
If your LOV is a select list then you need to dynamically re-populate the select list using Javascript and 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.