0

Please let me know what i am doing wrong here:

I need to add dynamic content to my htmy table using GWT. I am using setInnerHTML method for this

Element tableElement=(Element) Document.get().getElementById("htmltable");
tableElement.setInnerHTML("<tr><td>1</td><td>2000</td><td>2</td><td>3000</td></tr>");

But i am getting this error com.google.gwt.core.client.JavaScriptException: (Error): Unknown runtime error number: -2146827688 description: Unknown runtime error

Please let me know what i am doing wrong here.

zoom2arun
  • 1
  • 1

1 Answers1

1

this can be due to multiple reasons.

If this is happening on IE only this post covers it: Debugging IE8 Javascript Replace innerHTML Runtime Error

In Ie you can not set the inner html of a table element.

From GWT CellTableImplementation for IE:

IE doesn't support innerHTML on tbody, nor does it support removing or replacing a tbody. The only solution is to remove and replace the rows themselves.

Community
  • 1
  • 1
Daniel Kurka
  • 7,973
  • 2
  • 24
  • 43