Community
Participate
Working Groups
It is sometimes desirable to be able to render HTML content from the model in the Sapphire UI. To support this, we should add HtmlContent annotation that will allow developers to tag a value property as having HTML content. A corresponding property editor renderer will look for this annotation and render the content via SWT Browser control. Since the browser control has no editing abilities, this property editor will be read-only regardless of writable abilities of the property.
Enhancement implemented.
How to show bold/link...etc? The following test case only the text is shown: <html-content> <a href="http://www.oracle.com/">Oracle</a> <p>paragraph</p> <html><body>body</body></html> ABCD </html-content>
Make sure that property value represents a fully well-formed HTML document. The text is fed directly to a browser. For instance... <html> <body> <a href="http://www.oracle.com/">Oracle</a> <p>paragraph</p> ABCD </body> </html>
Meant to re-resolve.
Even well formed HTML does not work.
Could you attach your repro? Note that you can see this working in the contacts sample... Right click on contact and select "send contact". The wizard that comes up is based on ISendContactOp.
It is because I'm using the default XML binding? I expected all the children in the XML to show up in the browser. User error?
// *** HtmlContent *** @Label( standard = "HTML content" ) @XmlBinding( path = "html-content" ) @HtmlContent ValueProperty PROP_HTML_CONTENT = new ValueProperty( TYPE, "HtmlContent" ); Value<String> getHtmlContent();
Ah that makes sense. If you entered xml directly into source view and didn't escape tags, then this is user error. If you entered xml into a sapphire property editor and content wasn't escaped when written to source, then that is a bug (separate issue from this).
Re-resolving based on Comment #7 and Comment #9.
Verified