2015-05-04 96 views
-1

我正在使用JSFragment在View中顯示數據。 JSFragment(彈出)有幾個按鈕和列表。運行應用程序時,當我點擊片段中的按鈕時,它可以正常工作。但是,當我再次嘗試進入彈出我收到錯誤消息:SAPUI5彈出窗口不會第二次打開

Uncaught TypeError: Cannot read property 'addStyleClass' of undefined adding element with duplicate id 'popoverNavCon--me

我已經在使用的片段定義this.createId()很少提及到的ID。我無法找到我的錯誤。

+0

您之前創建的您將需要使用createId的片段,以及。閱讀[本]( https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/5da591c5a5a54740948acfe56b22fbc3.html)和[this](https://sapui5.netweaver.ondemand.com/sdk/#docs /guide/030fcd14963048218488048f407f8f34.html) –

回答

0

之前第二開口,叫你必須摧毀通過
sap.ui.getCore().byId("'popoverNavCon--me").destroy();// use the full ID!

+0

我已經在使用此語句:popover.attachAfterClose(function(){popover.destroy();});所以沒有必要使用你的想法。 –

+0

錯誤消息很明顯,您正在創建一個已創建ID的元素。沒有這個選項。 – zyrex