2013-12-18 56 views
0

我剛開始研究這個問題,但這對我來說一直是一個很好的資源。GWT-Java- Popup沒有失去焦點?

我需要創建一個彈出窗口(包含錯誤驗證),當用戶輸入數據來糾正彈出窗口中標識的問題時,這個窗口將保持「向上」。

當它們完成時,它們會關閉彈出窗口並再次嘗試保存。

這可能嗎?任何想法/建議?任何指導完成這將不勝感激。

**我正在使用GWT 2.4

謝謝!

回答

0

試試這個,

PopupPanel errorValidatorPopUp = new PopupPanel(); 
errorValidatorPopUp.center();// to show the popup at centre of page or 
           else you can setPosition 
errorValidatorPopUp.setGlassEnabled(true);//for Modal" effect blocking background 

/** your Logic for error validator **/ 
    Create a Panel with error validator widgets on it 
    Once done add to the errorValidatorPopup 

    eg : all your widgets on an errorPanel, 

errorValidatorPopup.add(errorPanel); 

errorValidatorPopup.show(); //to show popup 

可以對errorPanel一個按鈕來調用errorValidatorPopup.hide()一旦你驗證完成。

​​文檔以供參考是here

+0

所以,你的肯定,這將讓我在頁面上編輯小部件,而彈出的是在同一時間開放?我想我的問題是如何處理焦點...... eclipse實際上以我需要的方式運行。如果您選擇了一些代碼,control-F,用戶可以在查找彈出窗口和代碼之間切換焦點。 – TheJavaBeast

+0

我以爲你想要在彈出窗口上進行錯誤驗證..這將是模態你想要的是一個非模態彈出窗口。 – Onkar