wood burning stoves 2.0*
The moose likes Flex and the fly likes Problem in displaying HTML in flex Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Flex
Bookmark "Problem in displaying HTML in flex" Watch "Problem in displaying HTML in flex" New topic
Author

Problem in displaying HTML in flex

Siddhesh Deodhar
Ranch Hand

Joined: Mar 05, 2009
Posts: 117
Hi all,

I want to display HTML in my flex application. HTML that I want to display is output of tinyMCE rich text area plugin (http://tinymce.moxiecode.com).

Example of HTML text that i want to display is like follows



I tried using TextArea to display this HTML. I tried it using website http://polygeek.com/2249_flex_display-html-text-in-the-spark-textarea.
But the above HTML text does not gets displayed properly.

if HTML is in following format
<span color="#3333ff">testcolor</span>
Then it gets displayed properly using TextArea
but it fails if styles are used i.e.
<span style="color: #ff6600;">color</span>


Same is the case if I use htmlText="" atribute of <mx:text>.

Any other way in which i can display my HTML in Flex ? Mean time I am looking at how to change output format of HTML generated by TinyMCE




Good, Better, Best, Don't take rest until, Good becomes Better, and Better becomes Best.
Sidd : (SCJP 6 [90%] )
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Not really. Flex's support for HTML is very poor. If you need to display HTML I would consider a different technology. There are third party extensions to show HTML, but these will increase the size of your SWF considerably.

It is I think the bug/enhancement request with the biggest number of votes: see this.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
jp roberts
Greenhorn

Joined: Feb 19, 2009
Posts: 14
Have you tried this, http://livedocs.adobe.com/flex/3/html/help.html?content=textcontrols_04.html
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You should be very aware of the caveats Adobe list in that control. It supports a very small subset of HTML elements, some are broken (the < img /> tag does not work properly, the cursor behaviour of <a / > is easily broken, the <font /> size attribute behaves differently from the spec. etc.) and included a tag not listed in the HTML spec. (the <textformat /> tag).

Basically, if rendering standards compliant HTML is an important aspect of your application, use a browser - don't use Flex.
 
jQuery in Action, 2nd edition
 
subject: Problem in displaying HTML in flex
 
Similar Threads
converting html to pdf
select box
display richtext html entered with tinymce in table
How to highlight a hyperlink?(Urgent)
Removing a href tags using XSL