Loop through all page items in APEX
This blog has been sitting idle for too long. So starting off the New Year with a quick find!
Here is the problem:
We need to loop through all page items to apply some logic on demand, and preferably we want to do it dynamically.
Taking a look at apex.page there is a function called forEachPageItem.
This is not documented in https://apex.oracle.com/jsapi but it is public. This returns a function. Here is the internal function signature and comment inside of page.js as of APEX 20.2:
It looks like can you pass a specific form as a parameter, but I am using what they use inside the page.js when the form parameter is null in other spots. This gives us back all page items on the page.
Hope this can help someone as the majority of solutions I see online regarding this revolve already looking at the metadata views via PLSQL.