Idea Summary
Allow page items to be submitted in shared components > list of values or allow “extra values” display value to be derived from list of values.
Use Case
Use case is the following. Let's take the example of Product Teams in oracle as my LOV (shared components).
- A record has a foreign key to the product team table.
- The product teams can be deactivated. (statuses are ACTIVE/INACTIVE)
- A user should not be able to select a deactivated team.
- If a record is linked to a deactivated team, then the should should NOT be forced to change it.
The logical option is to create a shared component with where clause ``STATUS = ‘ACTIVE’
``` .
- If I set “Display Extra Value” and user opens a form he'll see the id (which doesn't make any sense). I know I can make display value and return value the same but that goes against the concept of return/display values of the shared component.
- If I uncheck “Display Extra Values” then the user is forced to select a new value, but he cannot see why because the value that is now no longer in the select list is not visible - he'll just see an empty value. Moreover, this user could be editing something else in that record and not know what new value to select.
There are 2 solutions that I currently know of:
The first solution is to not use a shared component but a query and do something like this:
select team_id ,team_name
from pt_teams
where status = 'ACTIVE'
UNION
select team_id ,team_name
from pt_teams
where team_id = :P1_TEAM_ID
This works great, but I can no longer use a shared component since there is a dependency on a page item.
The 2nd solution is to use a shared component but make that dependent on all page items of the referenced pages. The query for the shared component would then be:
select team_id ,team_name
from pt_teams
where status = 'ACTIVE'
UNION
select team_id ,team_name
from pt_teams
where team_id IN (:P1_TEAM_ID,:P2_TEAM_ID)
This works great too but is a little flaky because it needs to be updated whenever it is referenced on a new page. Also it could cause strange behaviour if the session state of the teams has a value for another page than the current.
Preferred Solution (Optional)
I see 2 possible solutions, both of which are not currently available in the product:
- It would be awesome if I could set the extra value as based on a list of values just like we can for items and report columns. In that case I could create 2 shared components: PRODUCT_TEAMS_ACTIVE (which would be the shared component for the select list) and PRODUCT_TEAMS_ALL (which would be the shared component for the extra values)
- If the List Of Values shared component would support page items to submit
Another cool related feature would be to allow display of disabled options (displayed but not selectable) just like in the JET select list