Search code examples
javascriptjavaiframegwtckeditor

IFrame method .getBody returns null


I am using CKEditor in GWT project, Where i am using 4 CKEditor into single UI. On change of dropDown am changing values of thod CKEditor textFields.

IFrameElement iframe = (IFrameElement) element;
iframe.getContentDocument().getBody().setInnerText(value);

Here iframe.getContentDocument() returns Document , But iframe.getContentDocument().getBody() reutrns null.

Where on first two ckeditor iframe.getContentDocument().getBody() , they perfectly working, but for the next two, iframe.getContentDocument().getBody() reutrns null. Hence getting error

Uncaught TypeError: Cannot set property 'textContent' of null at DOMImplWebkit_1_g$.setInnerText_2_g$ [as setInnerText_6_g$]....


Solution

  • I hope you are somewhere setting value as blank ("") for handling null pointer issues.