Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set summernote text programatically
#1
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.
Reply
#2
(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.
Reply
#3
Can you please provide a minimal test case showing your issue?
Reply
#4
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.


Attached Files
.zip   SummernoteTest.zip (Size: 89.92 KB / Downloads: 3)
Reply
#5
OK. I'll have a look and get back to you ASAP

Cheers
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)