Kurt Miller
Kurt Miller

Reputation: 567

How to pass data between fields in Oracle APEX 5.1?

This is a VERY basic question. Sorry for not providing any code I have NO IDEA how to even start tackling the problem I have lets say two fields... One is a date selector field and the other a regular text field. What I want is when I select a date (or type a date), the value comes in the second field... Just that...

I'm on APEX 5.1.4

Upvotes: 1

Views: 1453

Answers (2)

RLOG
RLOG

Reputation: 630

There are a few different ways to do this, probably the easiest way is as follows.

Assume your two items are P1_ITEM1 and P1_ITEM2.

Create a dynamic action which fires on change of item P1_ITEM1.

The true action of this should be action:set value, set type:PL/SQL Expression, item::P1_ITEM2, items to submit P1_ITEM1.

Upvotes: 1

Blurryface
Blurryface

Reputation: 344

Since you have stated that the second item is a text field, you could do this with the help of a dynamic action that sets the value of the second item when there is a change in the value of the first item ( date field).

The following would be the steps, if you are using component view:

  • Create Dynamic Action

    • When

      • Event : Change
      • Selection : Item(s)
      • Item : First Page Item
      • Condition : is not null
    • True Action

      • Action : Set Value
      • Fire on Page Load: No
      • Set Type: You can choose how you want to set the value of the second item on the page.

If you have the flexibility to change the second item to be a select list and you have a list of values that goes with a date, you could do this much simpler, with a Cascading LOV

  • On Second Item's - Under List of Values section

    • Cascading LOV Parent Item(s) : First Item
    • Page Items to Submit: First Item
    • List of Values definition: Here you can define the query.

Hope this helps.

Upvotes: 1

Related Questions