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

Problem with primefaces component p:schedule passing from 1.0.0-RC18 to 1.0.0-RC19 #148

Closed
danielemaddaluno opened this issue Jan 11, 2019 · 8 comments
Labels
Milestone

Comments

@danielemaddaluno
Copy link

danielemaddaluno commented Jan 11, 2019

Issue Overview

I have a p:schedule component in my page which uses a LazyScheduleModel like this:

@Named
@ViewScoped
public class EventsList implements Serializable {

	private ScheduleModel lazyEventModel;

	@Inject
	LogManager logon;
	
	@Inject
	NightService nightService;

	@Inject
	LocationService locationService;

	private Location selectedLocation;
	private List<Location> locations;

	@PostConstruct
	public void init() {
		locations = locationService.getLocationsFromDatabase(logon.getProvider());

		lazyEventModel = new LazyScheduleModel() {
			@Override
			public void loadEvents(Date start, Date end) {
				DateTime startLdt = CalendarUtils.toDateTime(start);
				DateTime endLdt = CalendarUtils.toDateTime(end);
				List<ScheduleEvent> events = nightService
						.getNightsScheduleEventsByProviderLocationAndDateTimeRange(logon.getProvider(), getSelectedLocation(), startLdt, endLdt);

				for (ScheduleEvent e : events) {
					addEvent(e);
				}
			}
		};
	}
    /* ... */
}

And in my page I have a p:schedule inside a form like this:

<p:schedule id="schedule" value="#{eventsList.lazyEventModel}" draggable="false" resizable="false"/>
Current Behaviour

From 1.0.0-RC19 and above:

  1. the events are not shown on the schedule component and loadEvents is never called.

  2. I get in the Google Chrome console the following error:
    screenshot 2019-01-12 00 25 58
    It is due to the js function showBar() from AdminLTE, the first time that the PF('statusDialog') is called gives me an Uncaught TypeError: Cannot read property 'show' of undefined.

Can't say if 1. and 2. are correlated.

Additional Information

Testing with 1.0.0-RC18 p:schedule works fine and this problem did not exist.
I tried again recompiling my ear with:

  • 1.0.0-RC19
  • 1.0.0-RC20
  • 1.0.0-RC21-SNAPSHOT

And all these 3 have this bug on the p:schedule component.

AdminFaces version: admin-template 1.0.0-RC19+
PrimeFaces version: PF 6.2
JSF implementation: Mojarra 2.2.15

@danielemaddaluno
Copy link
Author

danielemaddaluno commented Jan 12, 2019

@rmpestano answering to your previous #147 (comment)
Yes I see exactly the same thing on this page http://admin-showcase-admin-showcase.7e14.starter-us-west-2.openshiftapps.com/showcase/pages/components/schedule.xhtml#j_idt198:j_idt203
No ScheduleEvent at all and on chrome I have that error (graphically the schedule component is ok and I can move from a week to another).

screenshot 2019-01-12 01 17 14

screenshot 2019-01-12 01 16 39

@martinmikula
Copy link

I also found this problem, when i disabled renderAjaxStatus: admin.renderAjaxStatus=false, schedule works as expected, so it seems that statusDialog is not available in time when schedule is trying to get data for first time. Important line from javascript console:
Widget for var 'statusDialog' not available! error @ eNp1jFEOAiEMRE-0u__eBqEq2NJaiomJhxd3WU0wfs30zUtFI8HJeSiHdKugj2WLOZWn_NkmwXqOuQyOZ4UfRMIZso0uMTW6bDFsxV8gVIRlL-89NW5ODXS_kO_u2o8jsxVTJzPF3JkLrU9oMDIDEnT2eYsxAFcbtZV_HSpeGbFbL9AMe6s.js.xhtml?ln=omnifaces.combined&v=1547287635000:16415.

@rmpestano
Copy link
Contributor

Thank you @martinmikula, I'll have a look asap.

@rmpestano rmpestano added the bug label Jan 13, 2019
@rmpestano rmpestano added this to the 1.0.0 milestone Jan 13, 2019
@danielemaddaluno
Copy link
Author

danielemaddaluno commented Jan 15, 2019

I noticed that I have this problem on desktop browser:

Google Chrome (Google Chrome is up to date)
Version 71.0.3578.98 (Official Build) (64-bit)

And opening the same site from mobile with Google Chrome for mobile it works fine with any problems.

Application Version: Chrome 71.0.3578.99

@rmpestano
Copy link
Contributor

rmpestano commented Jan 15, 2019

Interestingly on desktop the ajaxStatus (here) calls a dialog to show loading image, see here and here.

On mobile the loading dialog is not called so that is probably related with the issue. I hope I can have a look at It today.

@rmpestano
Copy link
Contributor

rmpestano commented Jan 15, 2019

Also It is important to note that the loadding dialog was moved to the bottom of the template (to make the page load faster images should be at the bottom) so that is probably the cause.

rmpestano pushed a commit that referenced this issue Jan 17, 2019
@rmpestano
Copy link
Contributor

Hi again @danielemaddaluno,

As I suspected the issue was caused by loading dialog position on the template.

Can you try with admin-template 1.0.0-RC21-SNAPSHOT?

Don't forget to clean browser caches.

Thank you for reporting the issue.

@danielemaddaluno
Copy link
Author

Yeah! It works fine with the new 1.0.0-RC21-SNAPSHOT! 🥳
Great job and thank you again @rmpestano

@rmpestano rmpestano modified the milestones: 1.0.0, 1.0.0-RC21 Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants