2017-01-11 20 views
0

我有一個vaadin應用程序DateField。有時隨機地將日期和月份顯示爲null。語言環境設置爲德語。
有關如何防止這種情況的任何想法?Vaadin DateField顯示「null」而不是天和月

enter image description here

代替:

enter image description here

編輯:我做了一些更多的測試,在UI.init()方法我設置會話的語言環境。如果我刪除此行它的工作原理:

protected void init(VaadinRequest request) { 
    getSession().setLocale(Locale.getDefault()); 
    .... 
}  
+0

很抱歉,無法重現該問題。 –

回答

1

我想通了我必須設置UI第一的語言環境:

protected void init(VaadinRequest request) { 
    setLocale(Locale.getDefault()); 
    getSession().setLocale(Locale.getDefault()); 
    .... 
} 
相關問題