1
我需要OpenUI5的帮助。我在视图中创建按钮,并通过单击按钮它创建对话框窗口并抛出一个错误,所以我不能进入对话框的功能。在OpenUI5中创建对话框时出现重复的ID
按钮鉴于:
<m:Button text="{i18n>RESULTS_CHANCES_SEND_EMAIL}"
class="sapUiMediumMarginBegin results-button"
tap="sendToEmail"
press="sendToEmail"
icon="sap-icon://email">
功能的控制器:
sendToEmail: function() {
var email = new Dialog({
title: 'שליחת תוצאות לדוא"ל',
type: 'Message',
content: [
new Input('submitEmailInput', {
liveChange: function (oEvent) {
var sText = oEvent.getParameter('value');
var parent = oEvent.getSource().getParent();
parent.getBeginButton().setEnabled(sText.length > 0);
},
width: '100%',
placeholder: 'דואר אלקטרוני'
})
],
beginButton: new Button({
text: 'שליחה',
enabled: false,
icon: 'sap-icon://email',
press: function() {
//var sText = sap.ui.getCore().byId('submitEmailInput').getValue();
//MessageToast.show('Email is: ' + sText);
// here comes the API request
email.close();
}
}),
endButton: new Button({
text: 'סגירה',
icon: 'sap-icon://decline',
press: function() {
email.close();
}
}),
afterClose: function() {
email.destroy();
}
});
email.open();}
错误:duplicate id
非常感谢!
我正在学习UI5。我想我会在某个地方看到破坏可能会将HTML元素留在dom中。也许谷歌与其他案件相关的使用片段和销毁。 –