Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

11.5.0 Unable to change event behavior #46

Closed
j0nm1 opened this issue Apr 3, 2019 · 4 comments
Closed

11.5.0 Unable to change event behavior #46

j0nm1 opened this issue Apr 3, 2019 · 4 comments

Comments

@j0nm1
Copy link

j0nm1 commented Apr 3, 2019

I'm using CalendarFX 11.5.0 and want to restrict the user to only see the YearPage of the example. So I'm doing:

CalendarView calendarView = new CalendarView();
        calendarView.showYearPage();
        calendarView.setShowPageSwitcher(false);
        calendarView.setShowSearchField(false);
        calendarView.setShowSearchResultsTray(false);
        calendarView.setShowAddCalendarButton(false);
        calendarView.setShowPrintButton(false);
        calendarView.setShowDeveloperConsole(false);

The problem is that when I'm double-clicking a day, it switches the view. To change that behavior as well, I thought I simply have to provide a custom callback for the setEntryDetailsCallback function but this doesn't work.

calendarView.setEntryDetailsCallback(param -> { System.out.println("Test"); return true; });

But I'm not even getting the "Test" printed. Am I missing something?

@j0nm1
Copy link
Author

j0nm1 commented Apr 4, 2019

small update: I found out that the event triggers correctly on every page but not on the year page. Really strange.

@dlemmermann
Copy link
Collaborator

The callback's purpose is to bring up another UI when the user double clicks on an entry, e.g. a dialog or a popover, that allows the user to edit the entry. However, the switching between views is done by different code. When you double click a date in the year page / year view then a so-callled RequestEvent will be fired. This event "requests" the date and the CalendarView makes the DayView show up. If you want to see the events being created you can launch your application with -Dcalendarfx.developer=true. When this property is set you can bring up the "developer console" via SHORTCUT-D (CMD-D on Mac, CTRL-D on Windows). A drawer will show up at the bottom.

Screen Shot 2019-04-05 at 09 33 41

Ideally you take full control of your UI by putting your calendar together yourself and simply use the YearPage and leave out anything else.

@dlemmermann
Copy link
Collaborator

CalendarView basically represents a full-fledged calendar solution. If you want just a piece of it then you need to put it together yourself.

@j0nm1
Copy link
Author

j0nm1 commented Apr 8, 2019

Thank you!
That solved my problem, I'm using the YearView from now on and it works great.

@j0nm1 j0nm1 closed this as completed Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants