Problem with displaying of jsComponent

Hello
In my application, I created the jsComponent in which Ckeditor4 is rendered. The component itself is rendered correctly however it breaks the grid causing to render my component underneath others. It is probably caused by fact that the editor is added after the initialization of the whole screen.
image
I found out that after I resize the window everything replaces correctly and the example above looks fine. My question is: Is there any possibility to invoke the same event which is called on the window resize in StandardEditor class? This could fix my problem, but I’m still not sure if it is a good approach to this issue. Here is my code:
XML part:

 <layout expand="editActions" spacing="true">
    <form id="form" dataContainer="specialAdvertisementDc">
        <column width="350px">
            <textField id="titleField" property="title"/>
            <textField id="subtitleField" property="subtitle"/>
            <vbox height="100%" responsive="true" expand="ckeditor">
                <jsComponent id="ckeditor"
                             initFunctionName="ckeditor_app"
                             width="1200" height="auto">
                    <dependencies>
                        <dependency path="webjar://ckeditor4:/ckeditor.js"/>
                        <dependency path="vaadin://ckeditor/ckeditor-connector.js"/>
                    </dependencies>
                </jsComponent>
            </vbox>
        </column>
    </form>
    <hbox id="editActions" spacing="true">
        <button action="windowCommitAndClose"/>
        <button action="windowClose"/>
    </hbox>
</layout>

js part:

ckeditor_app = function () {
var connector = this;
var element = connector.getElement();
element.innerHTML = "<textarea name=\"editor\" id=\"editor\"></textarea>";

connector.onStateChange = function () {
    var state = connector.getState();
    var data = state.data;
    var editor = CKEDITOR.replace('editor',{
        resize_enabled: true
    });
  }
}

Hi,

Could you please attach a demo project, so I can investigate the issue?

Regards,
Gleb

Hi,

thanks for the reply here is my example project:
ckeditorExample.zip (1.6 MB)

Hi,

Thank you for the demo project. As a workaround, I’d recommend placing edit actions box at the bottom, e.g.:

<layout expand="spacer" spacing="true"> <!-- expand the spacer element -->
    <form id="form" dataContainer="exampleEntityDc">
        <column width="350px">
            <textField id="nameField" property="name"/>
            <vbox width="1200px">
                <jsComponent id="ckeditor"
                             initFunctionName="ckeditor_app"
                             width="100%">
                    <dependencies>
                        <dependency path="webjar://ckeditor4:/ckeditor.js"/>
                        <dependency path="vaadin://ckeditor/ckeditor-connector.js"/>
                    </dependencies>
                </jsComponent>
            </vbox>
        </column>
    </form>

    <label id="spacer"/> <!-- a workaround to place edit action box at the bottom -->

    <hbox id="editActions" spacing="true">
        <button action="windowCommitAndClose"/>
        <button action="windowClose"/>
    </hbox>
</layout>

Hi,
thank you for the fixing idea for this specific scenario, but it doesn’t fix my problem entirely. There are still 2 issues:

  • In my target project there are other fields under the editor. So this workaround only applies if there are no other fields under.
  • The editor is resizable. If I resize the editor down to the bottom, the editAction will flow above it. In this case resizing of the window is also the fix.

So like I said before, I just need to know how I can call the event which is triggered when Im resizing window of the browser.

Unfortunately, there is no such method available either in screen controller or in JS controller.