2015-05-04 97 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