Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.4K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 159 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 468 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
Problem with select list not populating first time when the page is loaded

Hi ,
I am using apex 4.1.0.00.32 and I have a problem when using two list list and sql report in a region
my first select list has the below query
SELECT user_type "UserType", web_user_type_uid "ReturnValue"
FROM gts_web_user_type
ORDER BY user_type
page action when value changed - submit page
my second select list will populated based on the first list value
my second select list query is
SELECT short_name "ShortName", web_user_uid "web_user_uid"
FROM gts_web_user
WHERE web_user_type_uid = :p36_usertype
ORDER BY short_name
page action when value changed - submit page
my report query is
select
"WEB_USER_UID",
"USER_NAME",
"SHORT_NAME",
"NAME",
gts_get_uid_to_user_type(web_user_type_uid) "USER TYPE",
"STATUS"
from "#OWNER#"."GTS_WEB_USER"
WHERE web_user_type_uid =:p36_usertype
AND web_user_uid = :p36_shortname
ORDER BY gts_get_uid_to_user_type(web_user_type_uid), short_name
my problem is when the page first loads the first select list is populated and the second select list which needs to be populated based on the value in the first select list doesnot populate and shows null .
the second select list and the report is only populated after I start changing values in the first list and not when the page loads .
example when the page loads
my first select list has value AGENT Then my second select list should list all the agents - but doesnot happen
when I change my selection from AGENT TO CUSTOMER Then my second select list populates and
when I com back and change my first select list value to AGENT then my second select list populates
also based on second select list my report populates . it is also has the same problem
my users need the list and the reports to populate when the page loads for the first time .
can anyone help me solve this problem .
Answers
-
The second query returns no rows because it's comparing web_user_type_uid to null - you need to use something like
web_user_type_uid = COALESCE(:P36_USERTYPE, web_user_type_uid)
Same for your report query, if either of the lists have no value, then it won't return any rows.
Additionally, you don't need to submit the page after each select change - you can use define the second select as cascading
Oracle APEX 4.0: Cascading LOVs/Select Lists | Inside Oracle APEX by Patrick Wolf
And the report can be refreshed using a dynamic action on change of the second list - just ensure you modify the report to submit the two items (attribute underneath SQL)
Scott.
-
Solution described & demoed here
Grassroots Oracle: APEX 101: Cascading Select Lists & Dynamic Actions