Thursday, May 2, 2024

VBCS - Load data before the page load in oracle visual builder | vbEnter event in VBCS


We will load a variable , data fetched from a rest service and then used to a page table before the page loads using vbenter event listener.

It’s a very common requirement in the web application where you need to load common data before the page load so the data can be used at multiple places. Whenever you have such a requirement in Visual Builder vbEnter will help you to load data before page load.

vbEnter Event in VBCS

Dispatched after all the page-scoped variables have been added and initialized to their default values, values from URL parameters, or persisted values. The event is used to trigger data fetches, which may occur concurrently.

Implemented steps:

  1. Create a visual application
  2. Create a web application.
  3. Create a service connection using below rest endpoints:
  4. Create a type on app level using service connecrion endpoint.
  5. Create a adp variable on app level using step4 type.
  6. Create a even listener on app level and select VbEnter event.
  7. In the vbenter action chain,
    1. Add a call rest action and select the all users endpoint
    2. Add an assign variable and assign the endpoint reaponse body to adp variable data.
  8. In the web app, open main-start page and drag and drop table and go to properties and data section and select the adp vaeiable to fetch the selected fields data.
  9. Test to Preview.

Detailed steps with screenshots:

No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...