Ugh, instead of that horrid, unreadable, un-debuggable code, create a custom
component, pass in currentItem, and code that component normally.  To use
htmltext in mxml, you will have to use CData or use entity references for
the special chars.  Instead, build the html string in an AS function.  You
will actually be able to debug it.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: [email protected] [mailto:[email protected]] On
Behalf Of dorkie dork from dorktown
Sent: Wednesday, May 27, 2009 11:25 PM
To: [email protected]
Subject: [flexcoders]Databinding in htmlText in repeater puzzle

 






If I have this code inside a htmlText field inside a Repeater:

<mx:Text id="postFooter1" width="100%" y="0"
htmlText="Posted in {postsrepeater.currentitem.categories.catego...@name}  |
{postsrepeater.currentit...@commentcount} Comments "  />

How can I wrap it in anchor tags? 

<mx:Text id="postFooter1" width="100%" y="0"
htmlText="Posted in <a
href='event:{postsrepeater.currentitem.categories.catego...@name}'>{postsRep
eater.currentitem.categories.catego...@name}</a>  |  <a
href='event:{postsrepeater.currentit...@commentcount}'>{postsRepeater.curren
tit...@commentcount} Comments</a> "  />

If I use the above code the compiler says:

The value of attribute "htmlText" must not contain the '<' character. 



Reply via email to