gpt4 book ai didi

java - GWT-EXT:Component.setId 生成随机前缀

转载 作者:太空宇宙 更新时间:2023-11-04 08:44:16 25 4
gpt4 key购买 nike

我使用 Component.setId(String id) 方法为我的网格设置 ID。我使用:

setId("ARTICLE_STOCK.ABSATZ.ZEITRAUM_MONAT");

但是后来 Firebug 告诉我这个 id 被设置为 HTML 对象:

ext-gen1454__ARTICLE_STOCK.ABSATZ.ZEITRAUM_MONAT 

为什么会有这个自动生成的前缀?我该如何改变这一点

最佳答案

我还没有尝试过,但请检查 ensureDebugId(String id) 方法。

来自文档:

Ensure that the main Element for this UIObject has an ID property set, which allows it to integrate with third-party libraries and test tools. Complex Widgets will also set the IDs of their important sub-elements. If the main element already has an ID, this method WILL override it. The ID that you specify will be prefixed by the static string DEBUG_ID_PREFIX. This method will be compiled out and will have no effect unless you inherit the DebugID module in your gwt.xml file (...)

看起来可能有帮助。

关于java - GWT-EXT:Component.setId 生成随机前缀,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4657858/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com