I have a bunch of TextBox-es dynamically generated. In the creation step, I assign an ID property to them. eg.
id = ... Button b = new Button(); b.setText("add textbox"); b.addClickHandler(new Clickhandler() { Textbox tb = new TextBox(); tb.getElement().setId(Integer.toString(id)); tb.setText("some text"); } id += 1;
I need to access them later by their identifiers, but I cannot do this. I tried using the DOM object to get the widget, but it throws an exception:
String id = "some id"; Element el = DOM.getElementById(id); String value = el.getAttribute("value"); - this line produces an exception.
I also tried using el.getInnerText, el.getNodeValue - no luck. I see in chrome debugger - text fields do not have value property.
source share