27
Views
3
Comments
Solved
[CKEditor 5] Refresh web block with CK Editor
CK Editor 5
Forge asset by valantic LCS
Application Type
Reactive

Hi there,

We use the CK Editor 5 for ODC to write the content of emails. We have placed the text editor within a web block, with a text input parameter (called "Text") as the initial data (see screenshot). 

It all works fine, but now we want to insert an email template in the text. The data of the email template is collected in the parent screen.

So at first, the email text is empty because it's a new email and the input parameter is empty as well. When we insert the email template, the input parameter "Text" changes to the text of the template. However, the text within the editor does not change unfortunately. It's needed to do a refresh on the web block I guess.

But I can't seem to figure out how to do this. To insert an action On Parameters Change does not work either.

Any ideas on how to solve this?


Scherm­afbeelding 2023-12-14 om 09.58.37.png
2019-09-30 07-35-56
Aurelio Junior
Solution

Hello,

Use the component's "SetContent" client action in your block's "OnParametersChanged" event to refresh the editor's content:

2023-10-21 19-42-11
Tousif Khan
Champion

Hello

Can you give a try to directly bind the input parameter to the editor, if it helps.

Also check with debugging that in actual your input parameter is getting the value which you are passing from the parent.

Just add a On parameter change event add one local variable and assign on it and put a breakpoint on it and see if you are getting the value.

Thanks

Tousif Khan


2019-09-30 07-35-56
Aurelio Junior
Solution

Hello,

Use the component's "SetContent" client action in your block's "OnParametersChanged" event to refresh the editor's content:

UserImage.jpg
Eric van Heesen

Thank you Aurelio, it works perfectly now!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.