- 3,734,280 Users
- 2,246,936 Discussions
- 7,857,218 Comments
- 380.9K All Categories
- 2.1K Data
- 203 Big Data Appliance
- 1.9K Data Science
- 446.1K Databases
- 220.4K General Database Discussions
- 23 Multilingual Engine
- 506 MySQL Community Space
- 459 NoSQL Database
- 7.7K Oracle Database Express Edition (XE)
- 2.8K ORDS, SODA & JSON in the Database
- 438 SQLcl
- 3.9K SQL Developer Data Modeler
- 185.4K SQL & PL/SQL
- 20.8K SQL Developer
- 291.3K Development
- 6 Developer Projects
- 117 Programming Languages
- 288.1K Development Tools
- 96 DevOps
- 3K QA/Testing
- 645.2K Java
- 18 Java Learning Subscription
- 36.9K Database Connectivity
- 149 Java Community Process
- 104 Java 25
- 22.1K Java APIs
- 137.7K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 12 Java Essentials
- 138 Java 8 Questions
- 85.9K Java Programming
- 79 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.2K Java SE
- 13.8K Java Security
- 195 Java User Groups
- 180 LiveLabs
- 34 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 165 Deutsche Oracle Community
- 1.2K Español
- 1.9K Japanese
- 225 Portuguese
Display different buttons depending on user
I recently received a request that I'm not sure how to implement in APEX.
It is about the fact that when a user logs in, he gets to see a 'different' button on an overview page.
Behind this button is a function that redirects the user to the right page.
The requirement is, however, that the name of the button should display something different depending on the status of the user.
Use Case 1: The user does not yet have a status in the process because he has not submitted anything. The button should therefore display something like: "Submit Form"
Use Case 2: Registered user has already submitted a form, button should display: "Take me to last status".
For that I have two tables:
- Table: holds all relevant values of the form
- Table: holds 'state of form', 'page' and 'ID' of tbl1
Depending on state of the form in tbl1, the corresponding row in table 2 will be updated.
So table 2 holds for example these values:
ID STATE PAGE
1 REQUESTED 14
3 APPROVED 17
I then created a function, which should set the page depending on logged in user and the entry in table 2.
create or replace function forwarding_to_page2(p_username in varchar2,p_key_value in number)
Get the target page depending on stored page column in table 2
where exists (select tbl1.RESP1 from TABLE1 tbl1
left outer join RESPONSIBLE1 r on r.RESPID=tbl1.RESPID
LEFT OUTER JOIN USERS u on u.UUID=r.UUID where lower(u.USERNAME) =lower(l_user))
when no_data_found then
/*Use current registration page as default page*/
The registered users occupy a role in table 1. These roles have a foreign key to the user table. This makes it possible to check which user is logging in and whether the logged-in user has a connection to table 1. On this basis, the function checks which page number is stored in table 2 then check and redirect user to this page.
If no data is found, then the user should be redirected to another page and the button should display something else.
So my actual question is, how can I display different text for a user that has not submitted a form yet (so is not in table 1 and table 2) and for a user that has already submitted a form (exists in table 1 and table 2).
I would be very grateful for some suggestions:)