0
votes

I understand that the default behavior of LOVs is the following:

SELECT business_desc as display_val,
       business_id as return_val
  FROM businesses

This attached to a select type page item P1_BUSINESS will display a list and when a list row is selected, then assign the business_id value to the page item P1_BUSINESS.

Is there a way to build a list of values to set the value of more than one page item that are not displayed? Using the below SQL:

SELECT business_desc as display_val,
       business_id as return_val,
       form_type,
       individual_flag
  FROM businesses

Where now when a user selects something from P1_BUSINESS it sets the values of that row/record as follows:

  • P1_BUSINESS = business_id (like it does by default)
  • P1_FORM_TYPE = form_type (P1_FORM_TYPE is a hidden page item)
  • P1_IND_FLAG = individual_flag (P1_IND_FLAG is a hidden page item)

I know I can do this with an onchange dynamic action, but just curious if can do inside the LOV or select page item (P1_BUSINESS) declaratively.

1
The normal "List of values" component does not have such a feature, however, the popup lov does have it. Search for apex lov additional outputs - there are several blogs showing how this works. - Koen Lostrie
Yes, i saw them, but based on what I've read I was under the impression you need to 'Display' those other fields as well. Assuming this is not the case? Will dig further into popup LOVs. Thx. - McRivers
No, you can set the "Visible" attribute to "No" for any additional columns. That way you'll just see the regular display value but when selecting it will pick up the additional ones too. - Koen Lostrie
feel free to add as an answer and i will give credit thx... - McRivers
Will do in the morning - no time now :) - Koen Lostrie

1 Answers

1
votes

In Shared Components > List Of Values, there is an attribute "Additional Display Columns". The help text on that screen says it all Additional display columns can be defined for item types that support multiple display columns, for example the Popup LOV. For item types that do not support multiple columns, these will be ignored. If adding additional display columns ensure that the return column is included in the column list. The return column can be set to Visible No and Searchable No if you do not want it displayed to users.

Example using emp/dept sample data:

  • Create a list of values on table emp with return empno and display ename. Save.
  • Edit the LOV and click Additional Display Columns > Select Columns. Select job as additional column.
  • In the IG, set Visible and Searchable to "No" and Apply Changes.
  • On the page, create 2 page items: P1_EMPNO (type popup LOV) and P1_JOB (type Text Field)
  • For P1_EMPNO, pick the LOV created above as shared component > List Of Values and add JOB:P2_JOB under Settings > Additional Output. JOB is the additional column name/alias and P2_JOB is the item it should map to.
  • Now when you run the page, observe that P1_JOB is populated when you select a value for P1_EMPNO