calendar date ondateselected

# <rich:calendar> and "ondateselected" event problem

## Description

The <rich:calendar> date selected event is fired before input update.

If time and apply elements are added to the calendar, "ondateselected" gets fired when a date is selected but before it's updated in input. Now we have three events instead of one. But it causes compatibility problem because this event was used by customers to save selected value via Ajax.

## Links

- RichFaces Forum

## How to reproduce

The described above problem occurs when <a4j:support>is put inside <rich:calendar>. If the "event" property is set to "ondateselected" previous value of the <rich:calendar> is stored after selection.

## Causes

Events firing sequence was changed.

## Workarounds

You need "onchanged" event to be fired after any change which causes input to be updated, both date and time.

Note, that

- "ondateselected" event is fired after a date is selected in popup

- "ontimechanged" event is fired after new time is selected.