I am currenly using version 7.2.4 of the Vaadin framework and I am having an interesting problem with the date field.
I have two date fields on the screen, basically a start date and end date. The resolution for both fields are set to Month and the format for both fields is “MMM yyyy”, just in case that make a difference. The code below is setup to first set the start date to a default value and then based on the value of the start fields, if necessary change the value of the end date. It also set the date start range and end range.
private void setBaseDates() {
if (this.df_BaseStart.getValue() == null) {
Calendar now = Calendar.getInstance();
Date start = SMSUtilities.genDate(now.get(Calendar.YEAR), (now.get(Calendar.MONTH)), 1);
this.df_BaseStart.setValue(start);
}
Date min = SMSUtilities.incrementDate(this.df_BaseStart.getValue(), TU.MONTH,1);
Date max = SMSUtilities.incrementDate(this.df_BaseStart.getValue(), TU.MONTH, 13);
if (this.df_BaseEnd.getValue() == null || this.df_BaseEnd.getValue().compareTo(min) < 0 || this.df_BaseEnd.getValue().compareTo(max) > 0) {
this.df_BaseEnd.setValue(min);
}
this.df_BaseEnd.setRangeStart(min);
this.df_BaseEnd.setRangeEnd(max);
}
But a few seconds after my code runs, the end date value is changed by something outside of my code. Below is the stack trace that I captured by putting a change trigger on the end date field. It seem to be set to todays date from what I can tell. Below is the stack trace I captured when the value change.
ProdSalesAnalysis$8.valueChange(Property$ValueChangeEvent) line: 321
GeneratedMethodAccessor36.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available
Method.invoke(Object, Object...) line: not available
ListenerMethod.receiveEvent(EventObject) line: 508
EventRouter.fireEvent(EventObject, ErrorHandler) line: 198
EventRouter.fireEvent(EventObject) line: 161
PopupDateField(AbstractClientConnector).fireEvent(EventObject) line: 984
PopupDateField(AbstractField<T>).fireValueChange(boolean) line: 1131
PopupDateField(AbstractField<T>).setValue(T, boolean) line: 542
PopupDateField(DateField).setValue(Date, boolean) line: 678
PopupDateField(DateField).changeVariables(Object, Map<String,Object>) line: 587
ServerRpcHandler.changeVariables(Object, VariableOwner, Map<String,Object>) line: 471
ServerRpcHandler.handleInvocations(UI, int, JSONArray) line: 289
ServerRpcHandler.handleRpc(UI, Reader, VaadinRequest) line: 168
UidlRequestHandler.synchronizedHandleRequest(VaadinSession, VaadinRequest, VaadinResponse) line: 93
UidlRequestHandler(SynchronizedRequestHandler).handleRequest(VaadinSession, VaadinRequest, VaadinResponse) line: 41
VaadinServletService(VaadinService).handleRequest(VaadinRequest, VaadinResponse) line: 1405
VaadinServlet.service(HttpServletRequest, HttpServletResponse) line: 237
VaadinServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 728
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 305
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 210
StandardWrapperValve.invoke(Request, Response) line: 222
StandardContextValve.invoke(Request, Response) line: 123
NonLoginAuthenticator(AuthenticatorBase).invoke(Request, Response) line: 472
StandardHostValve.invoke(Request, Response) line: 171
ErrorReportValve.invoke(Request, Response) line: 99
AccessLogValve.invoke(Request, Response) line: 953
StandardEngineValve.invoke(Request, Response) line: 118
CoyoteAdapter.service(Request, Response) line: 408
Http11Processor(AbstractHttp11Processor<S>).process(SocketWrapper<S>) line: 1023
Http11Protocol$Http11ConnectionHandler(AbstractProtocol$AbstractConnectionHandler<S,P>).process(SocketWrapper<S>, SocketStatus) line: 589
JIoEndpoint$SocketProcessor.run() line: 312
ThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker) line: not available
ThreadPoolExecutor$Worker.run() line: not available
TaskThread(Thread).run() line: not available
Can any one point me to what might be going on and how I can resolve the problem?