Set summernote text programatically

<< Click to Display Table of Contents >>

Navigation:  Forum >

Set summernote text programatically

Forum link

 

 

 


 

02-04-2023, 12:15 AM:

 

When setting the textarea of TIWSummernote (e.g. IWSummernote1.Lines.Add('...'); ) programmatically, the control acts as expected, nicely rendering formatted HTML text.

 

However, if the control is rendered in a project using bootstrap template, the text area appears to be rendered in a separate frame which does not occupy the full width, and the html is shown as a literal sting.

 

[attachment=539]

 

The code I am using in both scenarios is the same:

 

IWSummernote1.Lines.Add('<p>Hello<br><b>World</b></p>');

 

Using Intraweb 15.6.9 ultimate.

 

 

 


 

02-06-2023, 12:21 PM:

 

(02-04-2023, 12:15 AM)john.burgess Wrote: [ -> ]When setting the textarea of TIWSummernote (e.g. IWSummernote1.Lines.Add('...'); ) programmatically, the control acts as expected, nicely rendering formatted HTML text.

 

However, if the control is rendered in a project using bootstrap template, the text area appears to be rendered in a separate frame which does not occupy the full width, and the html is shown as a literal sting.

 

The code I am using in both scenarios is the same:

 

IWSummernote1.Lines.Add('<p>Hello<br><b>World</b></p>');

 

Using Intraweb 15.6.9 ultimate.

 

Just to provide more clarity to this problem I have discovered that IWSummernote renders OK if the text is set programmatically during form onShow but not if I attempt to (re)set the text programatically within an async method on the form - e.g. selecting an item from a IWBSSelect. So it seems this is not related to the use of templates but the ajax refresh of the control after the form has already been shown. I will continue testing this and add any further findings to this thread - but would appreciate any suggestions as to how it can be addressed.

 

 

 


 

02-10-2023, 03:19 AM:

 

Can you please provide a minimal test case showing your issue?

 

 

 


 

02-11-2023, 02:57 AM:

 

Thanks for looking at this Alexandre.

 

Attaching test project.

 

Text sets ok during form show event but not on button's OnAsyncClick

 

I have attempted without success various techniques such as asyncrefresh, invalidate etc. to get this to work during the async method.

 

 

 


 

02-12-2023, 10:36 PM:

 

OK. I'll have a look and get back to you ASAP

 

Cheers

 

 

 


 

04-03-2025, 08:16 AM:

 

(02-12-2023, 10:36 PM)Alexandre Machado Wrote: [ -> ]OK. I'll have a look and get back to you ASAP

 

Cheers

 

Hi Alexandre,

 

This is quite an old thread, so maybe it is solved and I missed it. I encounter the same problems as John. When I use an Async buttonclick to fill the content of the IWSummernote, nothing is shown. Just like him, I tried several refresh, repaint, asyncrender lines, but nothing changed. When I use a Sync buttonclick, the content is shown (but my full page is then rendered, so scroll positions and thelike are lost...

 

Using Intraweb 16.08

 

Cheers