15.08.2013 Views

Ektron® eWebEditPro Developer's Reference Guide

Ektron® eWebEditPro Developer's Reference Guide

Ektron® eWebEditPro Developer's Reference Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example:<br />

Both of the buttons below return the same content if a full XML document is loaded.<br />

<br />

<br />

Method: getBodyText<br />

Method: GetContent<br />

Description: Returns the content text without formatting. Note that only the text is<br />

returned, not the html code.<br />

This method is used by browser-based email applications that need both content<br />

with HTML tags and content that is text only.<br />

To use this method, first add a hidden field to post the text to the server. Then,<br />

when the content is saved, copy the text from the editor into the hidden field.<br />

These steps illustrate how to use this method.<br />

1. Add a hidden field to store the text. For example,<br />

<br />

2. Add JavaScript to copy the text to the hidden field. Use the<br />

<strong>eWebEditPro</strong>.onsave event. This event fires when the content is saved, that<br />

is, copied from the editor to the hidden content field.<br />

For example, if formName is the name of your form and MyContent1 is the<br />

name of the <strong>eWebEditPro</strong> editor, use this code.<br />

<br />

<strong>eWebEditPro</strong>.onsave = "document.formName.MyContentText1.value =<br />

<strong>eWebEditPro</strong>.instances.MyContent1.editor.getBodyText()";<br />

<br />

3. Modify your server-side code to process the text. You may wish to save it in a<br />

database field for text searches without the HTML tags. Alternatively, you<br />

may wish to email the text to clients with text-only viewers.<br />

Object: ”<strong>eWebEditPro</strong> ActiveX Control Object”<br />

Description: Retrieves the specified content type from the current edit session.<br />

This can be the body of the content, the data entered, or just the header<br />

information. Supported content types are listed in ”Content Type Categories” on<br />

page 507.<br />

Object: ”<strong>eWebEditPro</strong> ActiveX Control Object”<br />

Parameter: String - the content type to retrieve<br />

Return Type: String - the content retrieved<br />

<strong>Ektron®</strong> <strong>eWebEditPro</strong> Developer’s <strong>Reference</strong> <strong>Guide</strong>, Release 5.1, Revision 1 65

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!