I have a calendar on my main window screen which only display the current month and user is unable to navigate to previous or month ahead. I would like to add a function that allow the user to navigate backwards to previous months or forward to month in the future.
I got two listeners:
addForwardClickListener() - adds listener for calendar forward scrolling.
addBackwardClickListener() - adds listener for calendar backward scrolling.
but not sure if they are a solution.
If they can solve my problem, please provide me with an explanation and example on how to use them.
The Calendar component has navigationButtonsVisible attribute that allows user to navigate between weeks and days.
These listeners are associated with the navigation buttons, not the scrollbar: addForwardClickListener() - adds a listener that is invoked when the user clicks forward navigation button. The listener only works when the navigationButtonsVisible attribute is true. addBackwardClickListener() - adds a listener that is invoked when the user clicks backward navigation button. The listener only works when the navigationButtonsVisible attribute is true.
If you want to have navigation buttons to navigate between months you can use the following sample: XML descriptor