Been wanting to blog a little experiment I did with Oracle Process Cloud's Web form. Current version of PCS is limited to Web forms; no ADF. I'll post the other shortcomings of current PCS release in another blog. The only way to build dynamic field/value behavior (for now at least)is by using Javascript, JSON and REST.
Here is how you to build a 'drop down' that loads country names at run time.
Login to PCS account > composer> application.
Create a new form. I am calling it CountryList.
Drag and add a 'drop down' component on to the form. I am also adding a message component to show the selected country.
Click on the 'Create Rule' icon on top right of the form and add a new rule.
Type the rule below to load country list from a public JSON service on form load.
The code above reads country names from the JSON service and constructs a temporary array - v_Countries - from the 'name' elements of the JSON array. This temp array is then assigned to drop down Options.
Add an additional line to display the selected drop down value on message component. Web forms are smart enough to rerun the rules every time an event occurs in the component - which is value change in our case.
Test the form using the 'preview' button on top right.

No comments:
Post a Comment