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

VCalendarPanel throws NPE when DateField's time format is changed from 24h to 12h and popup calendar is opened #5160

Closed
vaadin-bot opened this issue May 7, 2014 · 1 comment

Comments

@vaadin-bot
Copy link
Collaborator

Originally by @tltv


This happens when DateField's resolution is SECOND, MINUTE or HOUR and popup calendar shows time, and it's initialized with a Locale that has 24h time format and then changed later to a Locale that has 12h time format.

When the locale has changed to 12h format, and user tries to open the popup window, nothing shows up. NullPointerException is thrown on client side.

Looks like VCalendarPanel.VTime.ampm ListBox widget is not checked and initialized when switching to 12h format.

Here's the stacktrace:

java.lang.NullPointerException: null 	
at com.vaadin.client.ui.VCalendarPanel$VTime.updateTimes(VCalendarPanel.java:1810) 	
at com.vaadin.client.ui.VCalendarPanel.renderCalendar(VCalendarPanel.java:826) 	
at com.vaadin.client.ui.datefield.PopupDateFieldConnector.updateFromUIDL(PopupDateFieldConnector.java:103) 	
at com.vaadin.client.ApplicationConnection$8.updateVaadin6StyleConnectors(ApplicationConnection.java:1860) 	
at com.vaadin.client.ApplicationConnection$8.execute(ApplicationConnection.java:1473) 	
at com.vaadin.client.ApplicationConfiguration.runWhenDependenciesLoaded(ApplicationConfiguration.java:535) 	
at com.vaadin.client.ApplicationConnection.handleUIDLMessage(ApplicationConnection.java:2331) 	
at com.vaadin.client.ApplicationConnection.handleReceivedJSONMessage(ApplicationConnection.java:1294) 	
at com.vaadin.client.ApplicationConnection.handleJSONText(ApplicationConnection.java:940) 	
at com.vaadin.client.ApplicationConnection.access$10(ApplicationConnection.java:925) 	
at com.vaadin.client.ApplicationConnection$4.onResponseReceived(ApplicationConnection.java:903) 	
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:259) 	
at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:412) 	
at sun.reflect.GeneratedMethodAccessor217.invoke(Unknown Source) 	
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 	
at java.lang.reflect.Method.invoke(Unknown Source) 	
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) 	
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) 	
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) 	
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338) 	
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219) 	
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) 	
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571) 	
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279) 	
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) 	
at com.google.gwt.core.client.impl.Impl.apply(Impl.java) 	
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:324) 	
at sun.reflect.GeneratedMethodAccessor208.invoke(Unknown Source) 	
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 	
at java.lang.reflect.Method.invoke(Unknown Source) 	
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) 	
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) 	
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) 	
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293) 	
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547) 	
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364) 	
at java.lang.Thread.run(Unknown Source)

Imported from https://dev.vaadin.com/ issue #13722

@vaadin-bot
Copy link
Collaborator Author

Originally by @tltv


Attachment added: DateFieldTimeTest.java (1.3 KiB)
Test case for #13722

@vaadin-bot vaadin-bot added the bug label Dec 10, 2016
@vaadin-bot vaadin-bot added this to the Vaadin 7.3.0.beta1 milestone Dec 10, 2016
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

1 participant