save/load HTML stream containing custom fields (controls)

General TRichView support forum. Please post your questions here
Post Reply
lwinter
Posts: 24
Joined: Thu Dec 01, 2005 4:42 am

save/load HTML stream containing custom fields (controls)

Post by lwinter »

Problem:
We have a text format that is essentially HTML, but with some references to custom fields. We want to be able to load this into the TRichViewEdit control and to have it instantiate up to 3 kinds of custom controls within the text, as well as creating simple HTML elements, like bold text or bullet points. The custom control will need to have 1 or 2 properties defined for them (eg. a label and content). We would also like to save the text in the same format as we loaded it (and using a stream in both instances).

We have looked at the options that appear to be available to us to do this and have seen that there is a RvHtmlImporter and TRichViewXML import/export. However, we cannot determine whether the above functionality is possible.

Question 1:
Is it possible to use a HTML component to load HTML that includes custom controls?

Question 2:
Is it possible to use a HTML component to save HTML that includes custom controls?

Question 3:
If it is possible to use XML to load and save contents, are there sample files that contain custom controls?

Example Custom HTML format:
Text in <b>bold</b> or <i>italic</i>,<p>
<ul>
<li>bullet point
</ul>
<CustomControl class="TCustomControl1" property1="Custom Control Label" property2="@some custom code@" />

Example in TRichView:
Text in bold or italic
• bullet point
Custom Control Label
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can save controls to HTML (XHTML) using OnSaveComponentToFile event.
No, you cannot load controls from HTML without modifying code of RVHtmlImporter.
Post Reply