YUI Rich Text Area Not working in my project

I want to use the YUI Rich Text Area in my project.

I copied the control over from the example project but when I include it on a container in for my WebPage it doesn’t render in properly. I checked the Console of the page and I’m getting this error:

Does anyone have incite as to why this might be happening and how to make it happy?

Being that the YUI Rich Text Area doesn’t use jQuery, I doubt that it’s involved. Have you tried putting that control into an empty project?

Also, keep in mind that it is a control sample. No work has been done to handle error conditions.

This is what get rendered when I include it in my project:


https://xojo.io/6e7bdf7f7a6e

Yeah, there’s an error, so the javascript necessary for setting up the control didn’t run.

If you put it in an empty project, does it work?

[quote=172184:@Greg O’Lone]Yeah, there’s an error, so the javascript necessary for setting up the control didn’t run.

If you put it in an empty project, does it work?[/quote]

Not working in a blank project either:
https://www.dropbox.com/s/mrfmcikpdydt74k/YUITest_EmbedFail.xojo_binary_project?dl=0

Figured it out. The Demo app was also using the App.Header to contain the stylesheet instead of using the Shared HTMLHeader method on the control itself.

This is the method that should be added to the control to get it to work in other projects:

Shared Function HTMLHeader(CurrentSession as WebSession) As string return "<link rel='stylesheet' type='text/css' href='http://yui.yahooapis.com/2.9.0/build/assets/skins/sam/skin.css'>" End Function

<https://xojo.com/issue/38448>

There’s another problem where you can only load this control once into your project. If you try to load the control a second time it throws a javascript exception when loading the libraries (assumedly because it has already loaded them?) or is this a problem with the XOJO framework?

Could not execute returned javascript: undefined is not a function Source: Xojo.createNamespace("yui.RTE"); Xojo.loadLibraries("http://yui.yahooapis.com/2.9.0/build/yahoo-dom-event/yahoo-dom-event.js", function() { Xojo.loadLibraries("http://yui.yahooapis.com/2.9.0/build/element/element-min.js", function() { Xojo.loadLibraries("http://yui.yahooapis.com/2.9.0/build/container/container_core-min.js", function() { Xojo.loadLibraries("http://yui.yahooapis.com/2.9.0/build/editor/simpleeditor-min.js", function() { setTimeout(RSCustom.yui.RTE.S5chwoCc_libraryLoaded(),10); }); }); }); });