Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用方法 Component.setId(String id) 为我的网格设置一个 ID。我用:
setId("ARTICLE_STOCK.ABSATZ.ZEITRAUM_MONAT");
但后来 Firebug 告诉我这个 id 设置为 HTML 对象:
ext-gen1454__ARTICLE_STOCK.ABSATZ.ZEITRAUM_MONAT
为什么会有这个自动生成的前缀?我该如何改变这个
我没试过,但检查ensureDebugId(String id)方法。
ensureDebugId(String id)
从文档中:
确保此 UIObject 的主元素具有 ID 属性集,这允许它与第三方库和测试工具集成。复杂的小部件也会设置其重要子元素的 ID。如果主元素已经有一个 ID,这个方法将覆盖它。您指定的 ID 将以静态字符串 DEBUG_ID_PREFIX 为前缀。除非您在 gwt.xml 文件中继承 DebugID 模块(...),否则此方法将被编译出来并且无效
似乎它可能会有所帮助。