Selecting the "Initialize API" option in the Action attribute creates an API, which makes the following API available to use within your Javascript code on the page:
FOS.utils.popupLOV.item(itemName).setValueByReturn(newValue)
This function sets both the display & return value of the Popup LOV. If there are any items in the "Additional Output" attribute, they will also be set with the correct values.
Simply by running this action on page load and providing the affected Popup LOV item(s) in the "Page Item(s)" attribute, you are then able to use the above mentioned function anywhere in a JavaScript context in your page.
Important Note: this feature only works with a Popup LOV whose source is a dynamic "List of Values" (based on an SQL query)
In the below example you can see the following behaviour:
- the slider values correspond to the Customer ID's
- on change of the slider, we are calling the API function on the "Customer" Popup LOV with the selected ID value
- the popup LOV is then set with the correct display & return value
- all the "Additional Output" item values are updated on change as well