5 Replies Latest reply on Mar 17, 2010 11:59 AM by cheftimo

    htmltext getting truncated in Text

    Prashant Waykar

      Hello sir,

      Can someone please help me out with dislpaying the htmltext

      This is my application.

      Thanks in advance.

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

          backgroundGradientColors="[#FFFFFF, #FFFFFF]"

      >

          <mx:Text width="100%" color="blue" fontStyle="italic" fontSize="14">

              <mx:htmlText>

                  <![CDATA[

      Click the links below to find out more information related to the e-learning

      industry.Thsi is the text area

       

      <li> ___ <img border="0" height="54"

      src="http://www.scientificamerican.com/media/inline/small-nuclear-reactor-mini-off-grid-us-supp lier_1.jpg"  width="59" /></li>

       

      <li> ___ <img border="0" height="54"  width="60" href="http://www.rrindia.com/gifs/india_map.jpg"

      src="http://www.rrindia.com/gifs/india_map.jpg"  /></li>

      <li> ___ <img border="0" height="84"  width="60" href="http://www.rrindia.com/gifs/india_map.jpg"

      src="http://www.rrindia.com/gifs/india_map.jpg"  /></li>

      <li> ___ <img border="0" height="104"  width="60" href="http://www.rrindia.com/gifs/india_map.jpg"

      src="http://www.rrindia.com/gifs/india_map.jpg"  /></li>

      <li> ___ <img border="0" height="54"  width="60" href="http://www.rrindia.com/gifs/india_map.jpg"

      src="http://www.rrindia.com/gifs/india_map.jpg"  /></li>

       

      <li> ___<img border="0" height="37"

      src="http://www.vicky.in/straightfrmtheheart/wp-content/uploads/2008/01/bajaj-small-car-lite.jp g"   width="70" /></li>

             ]]>

              </mx:htmlText>

          </mx:Text>

      </mx:Application>

        • 1. Re: htmltext getting truncated in Text
          cheftimo Level 2

          If you want Flex to calculate the height of the text control to fit all your htmlText, you have to explicitly specify a width in pixels, not a percentage.

           

          If you want to specify the with as a percentage, you must use Return characters to determine the number of lines.

           

          Have fun,

           

          Carlos

          • 2. Re: htmltext getting truncated in Text
            Prashant Waykar Level 1

            Hello sir,

            thanks for your reply.

            Can you please help me out as to how should i calculate the return characters for the htmltext?

            Or can you please suggest some demo for it.

            Awaiting your reply.

            • 3. Re: htmltext getting truncated in Text
              cheftimo Level 2

              For starters, read this:

               

              http://livedocs.adobe.com/flex/3/html/help.html?content=textcontrols_04.html.

               

               

               

              Also, I have found that, even if you enclose the HTML code in a [CDATA[]] tag, most of the time it’s a good idea to eliminate all white space you can.

               

               

              Example 1:

               

              <p>Each item in the local cart looks like the above image (now this is going to sound like a corporate voice recording):</p>
              <li>To remove an item from the local cart, press 1.</li><li>To add an item to the CyberCucina cart, press 2.</li><li>To change the number of items, edit the quantity 3.</li>
              

               

               

              Example 2:

               

              <p>Each item in the local cart looks like the above image (now this is going to sound like a corporate voice recording):</p>
              <li>To remove an item from the local cart, press 1.</li>
              <li>To add an item to the CyberCucina cart, press 2.</li>
              <li>To change the number of items, edit the quantity 3.</li>
              

               

              If you run the above code, you will see that Example 1 is the right rendering; Example 2, not so good.

               

              I have found that the Flex implementation of HTML rendering is rather MickeyMouse. I have had to play with this spacing thing a lot to get the rendering I want.

               

              HTH,

               

              Carlos

               

              1 person found this helpful
              • 4. Re: htmltext getting truncated in Text
                Prashant Waykar Level 1

                Hello sir,

                I tried my application given above by removing the white spaces but still it didnt work,

                SO can you please help me out with that..

                Awaiting your reply.

                Thanks once again

                • 5. Re: htmltext getting truncated in Text
                  cheftimo Level 2

                  The code I showed you is not the entire application. You have to create a new MXML app and use the code in there

                   

                  Did you read the document I pointed you to?

                   

                  You do have to perform some of this work yourself.

                  1 person found this helpful