John
John

Reputation: 361

Oracle apex dynamic action to populate value from table

I have a form that has several fields, one of which has to be populated depending on a condition.

For example, I have car A that is selected from a dropdown (list of values from a different table). When car A is selected, I want the next field in the form to populate the Rate for example .8 depending on what is in the Column Rate for Car A.

This is probably a dynamic action of some sort. Thanks!

Upvotes: 0

Views: 2323

Answers (1)

Richard Pascual
Richard Pascual

Reputation: 2021

You can also accomplish this without the dynamic typed event options on the designer panel. An easier approach would be to create:

  1. A select box item with the list of cars that has a REDIRECT and SET ITEM AS action. The redirect will be to the same page itself. (When the page reloads, the SELECT PAGE ITEM is set to what was chosen and is now available for reference by the SOURCE settings configured in step 2) This will happen any time a new value is selected for this item using the SELECT menu.

  2. Set your RATE ITEM value (suggested as DISPLAY ONLY as this is a derived value). Your source value is a look up based on the input from the SELECT ITEM. A STATIC type is fine for a rate reference that isn't too complicated and does not change much.[1]

The ITEM set in (2) should be set to populate ON PAGE REFRESH. That Javascript/AJAX and Dynamic actions stuff may have use for more complicated user interactions, but try the simple approach first. It works fine.

Just in case you're wondering: CASCADING values is not necessary unless there is a special range of multiple RATES available (but still can only select one) related exclusively to the SELECTED ITEM value. The input of one ITEM can affect the CHOICES available for the next item.

[1]: A table-driven (dynamic query type) approach also requires maintenance but does not need to alter a deployed build once you've set it up. Static references are coded in the app design pattern.

Upvotes: 1

Related Questions