如何获得smartgwt小部件的html元素ID? [英] how to get html element id of smartgwt widgets?
问题描述
我想获得输入栏位的HTML ID& TextItem小部件的图标字段,我该怎么做?
(没有getId方法可用于TextItem小部件&似乎setAttribiute(id,foo)没有效果)
I want get html id of input field & icon field of a TextItem widget, how can i do this ??? (no getId methos is available for TextItem widget & seems that setAttribiute("id", "foo") has no effect)
推荐答案
由于所有内容都在单个页面上,我不敢自己设置任何标识,因此使用相同标识创建两个项目(错误)的概率相当高。
为什么你还需要它?
since everything is on a single page, i wouldn't dare to set any IDs yourself, the probability that you create two items (by mistake) with the same id is quite high. why would you need it anyway?
您可以通过名称
获取html元素textItem.setName(foo);
DOM.getElementsByName(foo)
you may get the html element by name textItem.setName("foo"); DOM.getElementsByName("foo")
这篇关于如何获得smartgwt小部件的html元素ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!