Reputation: 2210
Not Sure if the Documenatation is out of Date, but the standard code for creating a new richtext editor returns
Cannot read property 'RichTextEditor' of undefined
It looks like this is because there is no sap.ui.richtexteditor in the list of included resources.
var oRichTextEditor1 = new sap.ui.richtexteditor.RichTextEditor("myRTE1", {
width:"100%",
height:"300px",
showGroupClipboard:true,
showGroupStructure:true,
showGroupFont:true,
showGroupInsert:true,
showGroupLink:true,
showGroupUndo:true,
tooltip:"My RTE Tooltip"
});
What are my other options for a RichText/WYSIWYG editor in SAPUI5 ?
Upvotes: 0
Views: 5089
Reputation: 3994
You should use the sap.ui.define syntax to require the RichTextEditor control in your controller. As the control library is not included in the resources, it would not be readily available.
sap.ui.define([
"com/sap/app/controller/BaseController",
.
.
.
"sap/ui/richtexteditor/RichTextEditor"
], function (BaseController, ........, RichTextEditor) {
onAfterRendering: function () {
var oRichTextEditor1 = new RichTextEditor("myRTE1", {
width:"100%",
height:"300px",
showGroupClipboard:true,
showGroupStructure:true,
showGroupFont:true,
showGroupInsert:true,
showGroupLink:true,
showGroupUndo:true,
tooltip:"My RTE Tooltip"
});
}
});
Upvotes: 2