antonpug
antonpug

Reputation: 14296

How to load select lists based on a datepicker selection in Oracle Apex?

I have a date picker, but I also have three select lists for Day, Month, and Year. How can I load those as soon as the date picker is used to select a date?

Upvotes: 0

Views: 3450

Answers (2)

Anshul Ayushya
Anshul Ayushya

Reputation: 129

In Year range, just put the previous year nothing to do with Manual.

Upvotes: 0

Tom
Tom

Reputation: 7028

I've made a small example: here

page setup

I have the standard datepicker set up, i did restrict the range of years on this one (2005-2015).

The three select lists i have filled up with static lovs: days -> 1 through 31, months -> 1 through 12 buth with their name as display value, years -> 2005 through 2015.

To set their values, i created a dynamic action on the datepicker: dynamic action properties

3 actions are required, to set the selected value of each select list. Be aware though, this causes 3 ajax calls. But the implementation is basic and doesn't require you to write javascript and ajax callbacks.

Each action is similar to this one: set value for days select list

  • Days: TO_CHAR(TO_DATE(:P24_SOME_DATE), 'DD')
  • Months: LTRIM(TO_CHAR(TO_DATE(:P24_SOME_DATE), 'MM'), '0')
  • Years: TO_CHAR(TO_DATE(:P24_SOME_DATE), 'YYYY')

Mix 'n Match to suit what you need. Hope this helps!

Upvotes: 1

Related Questions