views:

382

answers:

1

Given a rich text editor, I want to save the "rich" text to a database, and load it later.

So how can I get and set the rich text?

I looked at the API and there is a property called text which is only PLAIN text, not what I need. There is another property called textSnapshot which sounds like maybe thats what I need to use, but its READ-ONLY so I can't set it?

Is there a way to do this?

Thanks!

UPDATE

It turns out I am only going to save it from a RichTextEditor, and I need to set it has htmlText on a Text control,

so is there a way to get the rich text and convert it to hmtlText?

+1  A: 

I'm not sure what you mean by rich text. The htmlText holds all the informations which the components use for rendering the HTML text, and which is also the base of the RichTextEditor rendering. You can get and set it, and that's exactly what you need to store in the DB and put the text back after retrieving it. There's no export it as rtf out of the component. It's rich in the sense that it's more than a simple textInput :)

Robert Bak
So you get it and set it via the htmlText property,I should have known! Thanks
John Isaacks
Just an addition - it doesn't really create anything a sane person would call proper HTML, so if you want to use it somewhere else you can find a nice class to convert between "RTE Html" and "regular HTML" here - http://blog.flashweb.org/archives/7
Robert Bak