RichTextArea - problem with setValue()

Hello,

I am trying to use the component RichTextArea but it doesnt get the text by the setValue() metod. It cames compleatly empty.

Also on the example on the page of Vaadin the component doesnt work. It should show a text but is compleatly empty.
(
https://demo.vaadin.com/sampler/#ui/data-input/text-input/rich-text-area
)

Below can you see my code. I tryed open my APP and the link example of the RichTextArea on the Vaadin page on the browser Chrome, IExplorer and FIrefox without succes.

[code]
RichTextArea rtaMainProduct = new RichTextArea();
rtaMainProduct.setSizeFull();

    Layout tab2 = new VerticalLayout();
    tab2.addComponent(rtaMainProduct);

    rtaMainProduct.setValue("<h1>Hello</h1>\n" +
        "<p>This rich text area contains some text.</p>");

[/code]Maybe may someone help me? Thank you in advanced.

Best regards,

Dante Dantas

Ok, now I know why it happens.

I let the RichTextArea inside of a Accordion. If I let it outside it works well.

[code]
Accordion accordion = new Accordion();

RichTextArea rtaMainProduct = new RichTextArea();
rtaMainProduct.setSizeFull();

Layout tab2 = new VerticalLayout();
tab2.addComponent(rtaMainProduct);

accordion.addTab(tab2, “Text”, VaadinIcons.PACKAGE, 0);

rtaMainProduct.setValue(“

Hello

\n” +

This rich text area contains some text.

”);
[/code]Some idea what I did “wrong” and/or what should I do?

Thank you in advanced.
Best Regards,

Dante

Sounds like a bug in my opinion. Can you create a ticket at https://github.com/vaadin/framework/issues ?

-Olli

Done. Thank you for the reply.

https://github.com/vaadin/framework/issues/10299

In Vaadin 8.3.0 still the same problem. The content will be randomly shown or not shown. I use current version of firefox (58.0.1 (64-Bit).

Does anybody know a workaround. RichTextArea is the only component with HTML content and automatic line breaks. But empty RichTextAreas are very bad :-(.

Wolf

Addendum: You do not need an Accordeon to produce this bug. You can take a simple Window with VerticalLayout, this is my example. You see the text for a moment and then the text disappears. In 10 to 20 percent of my trials the text does not disappear.

My workaround:

First visible RichAreaText in disabled mode - the content will be shown. Start a Timer thread and enable the RichAreaText component - the content stays visible and can be edited. I use 200 milliseconds, that seems to be enough in my case.

Regards, Wolf

Hello,

I’m facing the same problem.

Is there any solution??

Wolf Michna, would you mind to post how you made it work??

Best regards,

Iban

Do you know when it’s going to be solved??