Aison
Aison

Reputation: 165

sapui5:How to display base64 image in Rich text editor?

I created an img element string with base64 source. when tried to display it in sap.ui.richtexteditor.RichTextEditor, I got nothing. How to display it? see my code.

// controller
var template = {};
var image ="<img src="data:image/bmp;base64,/9j/4AAQSkZJRg...">";
template.body = image;
var oViewModel = new JSONModel(template);
this.getView().setModel(oViewModel, "template");
//view
<rte:RichTextEditor id="rte" value="{template>/body}" editorType="TinyMCE4" customToolbar="true" showGroupFont="true" showGroupInsert="true"
showGroupLink="true" height="360px"/>

Upvotes: 0

Views: 2389

Answers (1)

Y15
Y15

Reputation: 86

why dont use the Image Control?

<Image src='data:image/png;base64,iVBORw0KGgoA...........=='/>

Upvotes: 1

Related Questions