WebControlWrapper and TinyMCE

Hi all,

I have created a working sample of TinyMCE in DreamWeaver, simply to prove myself that I understand what I need and because it is easier to debug.

I created a WebControlWrapper, read the WebControlSDK, followed the samples and I believe I have everything setup as it should.
To keep thing simple I tried to create a very basic control.

Can someone help me to find out why I only see the text area and not the editor?

FYI the _init function is called and executed (checked with an alert) and the tinymce.init method is really a function (code flows) so imho the libraries are loaded…

This is how I initialise:

XojoCustom.it2be.editor.<<var>>_init = function() { if (typeof tinymce.init == "function") { tinymce.init({ selector : "textarea#<<var>>_it2be", width : <<width>>, height : <<height>>, resize : false, onchange_callback : "Xojo.triggerServerEvent('<<var>>', 'ContentChanged')" }); } };

This is my open method (tried it with and without the timeout):

LoadLibraries("setTimeout(XojoCustom.it2be.editor." + Self.ControlID + "_init(), 10);","https://my.domain.name/tinymce/tinymce.min.js")

This is my SetupHTML method:

[code] Dim source() As String

source.Append("<div id=""" + self.ControlID + “”">")
source.append("<textarea id=""" + self.ControlID + “_it2be”">" + Content + “”)
source.append("")

Return Join(source, “”)[/code]

This is my SetupJavascriptFramework method:

[code] Dim source() As String
Dim src As String = kInitializer

src = src.ReplaceAll("<>", Self.ControlID)
src = src.ReplaceAll("<>", CStr(Self.Width - 2))
src = src.ReplaceAll("<>", CStr(Self.Height - 78))

source.Append(src)

Return Join(source, EndOfLine)[/code]

All help is appreciated.

Thanks,

Marcel

Check the following link

Hi Antonis,

Thank you for your reply and for creating this editor.
I did use it to guide me in the ‘world of wrappers’ :slight_smile:

TinyMCE does not work at all within a WebControlWrapper.
CKEditor works but with a few oddities (probably my doing).
Your editor works of course :slight_smile:

But… Even with your editor I have an issue once I place it in a container (subclassed from a parent container) and make the container visible.
After the error the editor shows up nicely but my listbox is empty :frowning:
Control ‘BwsV1NPp’ is the wrapper.

Any idea how to solve or work around this?

Could not execute returned javascript: ‘undefined’ is not an object (evaluating ‘Xojo.controls[‘BwsV1NPp’].refresh’)
Source: Xojo.menus.create({ menuID: “NtLfhoKqpe”, text: “”, enabled: false, children: [] });
Xojo.controls.NMeLzUJN.items[“ListMenu”].menu = “NtLfhoKqpe”;
Xojo.controls.NMeLzUJN.setItemEnabled(“ListMenu”,false);
Xojo.controls[‘OlWboAO8’].setValue(“13”);
Xojo.controls[‘GiZpcska’].setPlaceholder(‘Templates’);
Xojo.controls[‘GiZpcska’].object().setAttribute(‘title’,‘Name:xxx,Subject:xxx,Body:xxx’);
Xojo.controls[‘GiZpcska’].refresh();
Xojo.controls[‘GiZpcska’].setValue(“Body:”);
Xojo.controls[‘FxB579yY’].setVisible(false);
Xojo.controls[‘GF7OM13Z’].setVisible(true);
Xojo.controls[‘EY3VgazL’].refresh();
Xojo.controls[‘BwsV1NPp’].refresh();
Xojo.controls[‘V6KuxSqp’].refresh();
Xojo.controls[‘RMEMJxy7’].refresh();
Xojo.controls[‘LHAPvYyO’].refresh();
Xojo.controls[‘IOjebJA6’].refresh();
Xojo.controls[‘Gd41zDNj’].refresh();
Xojo.controls[‘IieDonBG’].refresh();
Xojo.controls[‘A4MlFx8S’].refresh();
Xojo.controls[‘JRkZEYMR’].refresh();
Xojo.controls[‘EY3VgazL’].deleteAllRows();
Xojo.controls[‘EY3VgazL’].insertRow(0,[""]);
Xojo.controls[‘EY3VgazL’].insertRow(1,[""]);
etc…

Send me your project file to check it.

Hello Marcel , Antonis , any update on this project, i was interested as well on how you implemented that TinyMCE and how you can have it work properly, so far i see your example in the Xojo sample projects but still nothing about TinyMCE

Thanks.

I have a WYSIWYG control called HTML Edit for both Web and Desktop
It uses Quill instead of TinyMCE, but it’s ready to go, just drag and drop it right in.

I keep it updated regularly, and am always happy to help by email.

[quote=245937:@Tim Parnell]I have a WYSIWYG control called HTML Edit for both Web and Desktop
It uses Quill instead of TinyMCE, but it’s ready to go, just drag and drop it right in.

I keep it updated regularly, and am always happy to help by email.[/quote]
Thanks Tim, the idea was to replace the existing app with a web app and give the ability to edit the existing documents over the web version so it will avoid the need of getting office or other editor apps for the in house documents, ill have a look into your link and if its ok then i`ll drop you a email.

Thanks.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.