cordova - 收到错误消息 "Registering a component with a id (` form 1`) which has already been used"

标签 cordova sencha-touch extjs sencha-touch-2

当我点击同一个按钮超过 1 次时,我收到此错误。这表明什么,我应该采取什么措施来防止它;

[WARN] [WARN][Ext.Component#constructor] Registering a component with a id (`form1`) which has already been used. Please ensure the existing component has been destroyed (`Ext.Component#destroy()`.
2012-05-08 21:29:56.869 ProjectSeal[870:fb03] [WARN] [WARN][Ext.Component#constructor] Registering a component with a id (`new-note-btn1`) which has already been used. Please ensure the existing component has been destroyed (`Ext.Component#destroy()`.

根据错误/警告,我如何销毁组件?

更新

Ext.define('app.view.Contact',{
           extend:'Ext.form.Panel',
           xtype:'contactform',
           id: 'form1',
....

如何让 Sencha 将 id 添加到我的代码中?

更新

[WARN] [DEPRECATE][Anonymous] itemId is deprecated as a property directly on the Component. Please put it inside the config object, and retrieve it using "this.config.itemId"

最佳答案

当用户单击按钮时,您很可能会创建一个窗口或表单对象。在创建过程中,您似乎正在将硬编码的 id 分配给该组件。

您需要确保先前使用的表单已被销毁(例如,检查 closeAction 属性),或者不要自己分配 id 属性并让 Sencha 执行此操作。

关于cordova - 收到错误消息 "Registering a component with a id (` form 1`) which has already been used",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10502190/

相关文章:

android - 在 mac 错误 2 上展开 ADT

android - 我如何检测 Cordova 应用程序何时从 Android 插件中的最近菜单中删除?

ios - 安装 CocoaPods 后的 Xcode 错误 - 没有这样的文件或目录

android - PhoneGap 两次显示 HTML 输入类型按钮的值

javascript - 如何在 Ext.Message.Box 中使用 keydown 事件

javascript - CompositeField 上的自定义 FieldLabel

javascript - 将数据绑定(bind)到 ExtJS 存储中的其余代理中查看

android - Sencha Touch 打包到 Android 报错

javascript - Sencha touch 2 ProgressBar.js 文件未找到

javascript - 如何使用 sencha-touch.jsb3 构建 Sencha Touch?