我有一個應該使用對話框模塊中的數據更新的面板。在面板構造函數中,我有一個應該填充面板中組件的數據模型。使用對話框模式更新檢票面板
小組構造是這樣的:
public MyPanel(String id, final MyDataMOdel aDataModel) {
super(id);
....
}
面板在我的網頁添加爲:
MyDataModel myDataModel = new MyDataModel();
MyPanel myPanel = new MyPanel("myPanel", myDataModel);
在打開的對話框setWindowClosedCallback
法,我有我更新的DataModel
myModal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback()
{
private static final long serialVersionUID = -1746088901018629567L;
public void onClose(AjaxRequestTarget target)
{
update myDataModel here
Got the updated datamodel here (I can see that it is updated)
target.add(myPanel)
....
這樣,我看不到面板中的組件得到更新。