2 Replies Latest reply on Mar 29, 2011 8:19 AM by AJFish

    s:ButtonBar with word wrap or linebreaks?

    AJFish

      I'm new to using Flex (my programming experience is mainly in PHP, ColdFusion, and Javascript) and am currently experiencing some frustration with the Spark ButtonBar component.  I currently have one that looks like something like this:

       

      <s:ButtonBar change="changeTable(event);" width="600">

          <mx:ArrayCollection>
              <fx:String>lorem ipsum dolor etc this text is really long</fx:String>
              ....
          </mx:ArrayCollection>

      </s:ButtonBar>

       

      The first button gets displayed as "lorem ipsum dolor etc this text is really lo...".  If I insert &#13; or {\n} after "lorem", I get  "lorem...".

       

      I've tried googling for solutions and the only things I find are suggestions to extend the ButtonBar class in ActionScript.  Like I said, though, I'm new to the language, so none of the code that I saw made much sense to me.  Is there any simple solution to this issue?

        • 1. Re: s:ButtonBar with word wrap or linebreaks?
          Flex harUI Adobe Employee

          You should be able to change the skins and make the label multiline.

          • 2. Re: s:ButtonBar with word wrap or linebreaks?
            AJFish Level 1

            Awesome, thanks.  For anyone else having this problem, what I ended up doing was creating a new skin copied from the ButtonBar skin, and then creating new skins based on the ButtonBarFirstButtonSkin (and middle and last buttons).  I removed the "max_displayed_lines" attribute from the label tag in the first/middle/last button skins, changed the buttons in the buttonbar skin to use these skins, and changed my buttonbar to use the new buttonbar skin.

             

            (Deleted my first edit to this post. I had copied the mx buttons rather than the spark buttons by mistake.  The spark buttons should have labels.)


            Message was edited by: AJFish