What I have done in the past is store my HTML text as valid XHTML
(which is really XML) and send that via remoting. When I retrieve
this from the server, I place the text in an TextArea and set
condenseWhite="true", this takes care of the white spaces. I then
have buttons to spawn the RTE control and pass along the condensed
text. Another trick is to have a hidden regular text box, use that
to store the XHTML text with no whites space and have another box to
display the HTML value of the first box:
// display text
<mx:TextArea htmlText="{hintCode.text}" editable="false" top="37"
left="10" right="10" condenseWhite="true" bottom="10"/>
//hidden text field
<mx:TextArea visible="false" x="10" y="210" width="576" id="hintCode"
condenseWhite="true" height="17"/>
Pass the hintCode.text value to the RTE.htmlText value. I am sure
this is already confusing enough, haha... but I hope this helps
somewhat.
- mr
--- In [email protected], Ben Marchbanks <[EMAIL PROTECTED]> wrote:
>
> Actually I want an XML formatted result from the
> server.
>
> What I don't want is for the rich text to be
> interpreted as an XML string when applying it to
> the text control as htmlText.
>
> All the white space in the XML string gets
> rendered as white space in the text control while
> it does render the text as HTML.
>
> For now I have used AS to strip out all the white
> space ( between the ending and beginning tags) and
> then apply the htmlText to the text control.
>
> Maybe I am still missing the easy solution............
>
>
> Brian Holmes wrote:
> > You need to escape the xml formatting before sending it to the client.
> > In cold fusion you could use the XMLFormat() function so if you're
using
> > cf, just wrap that around your return, or find a similar function for
> > the back end lang you're using.
> >
> >
> > Brian..
> >
> > -----Original Message-----
> > From: [email protected]
[mailto:[EMAIL PROTECTED] On
> > Behalf Of pdflibpilot
> > Sent: Monday, February 26, 2007 9:54 PM
> > To: [email protected]
> > Subject: [flexcoders] Storing / retrieving rich text
> >
> > I am trying to develop a method to allow web administrators to be able
> > to edit text in their Flex application directly in the UI (without
> > Flex). This text gets saved to mySQL when they close the rich text
> > editor.
> >
> > The data is stored correctly in mySQL however when its retrieved
it gets
> > formated as an XML object when extracted from the event.result.
> >
> > While this makes it easy to populate the various labels and text
objects
> > with the rich text data. The problem is that the rich text data gets
> > formatted as XML with new lines and indents. Like in this
> > dmup............
> >
> > <contentLive>
> > <TEXTFORMAT LEADING="2">
> > <P ALIGN="CENTER">
> > <FONT FACE="Verdana" SIZE="14" COLOR="#FFFFFF" LETTERSPACING="0"
> > KERNING="0">
> > <B>This is </B>
> > <FONT COLOR="#0033FF">
> > <B>
> > <U>live content</U>
> > </B>
> > </FONT>
> > </FONT>
> > </P>
> > </TEXTFORMAT>
> > </contentLive>
> >
> > How can I force it to treat it as raw text just like its stored in
mySQL
> > without the formatting ?
> >
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
--------------------~-->
> > Great things are happening at Yahoo! Groups. See the new email
design.
> > http://us.click.yahoo.com/lOt0.A/hOaOAA/yQLSAA/nhFolB/TM
> >
--------------------------------------------------------------------~->
> >
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives:
> > http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> > ***
> > The information in this e-mail is confidential and intended solely
for the individual or entity to whom it is addressed. If you have
received this e-mail in error please notify the sender by return
e-mail delete this e-mail and refrain from any disclosure or action
based on the information.
> > ***
> >
>