3 Replies Latest reply on Sep 17, 2009 5:57 PM by Peter Flynn (Adobe)

    Design-Time Data with external url linking

    trancepriest Level 1

      I have a data list here:



      In the portfolio section I would like to make links which are clickable for the portfolio items. I now know how to use Flex Builder to make external URL links for regular buttons. What I don't know is how to edit this data list to create external links. Any help would be appreciated.

        • 1. Re: Design-Time Data with external url linking
          Peter Flynn (Adobe) Adobe Employee

          Hi trancepriest,


          First, if you haven't already, you probably want to read some of the other posts here about creating a URL link button.  Once you've tried doing that and feel comfortable setting up a simple URL link in a test project, then you can move on to integrating this functionality into your list.


          Now -- the rest depends on how the data is represented in your list.  From some of your other posts here, it actually sounds like you're no longer using a list at all, but rather just a tall layout of hardcoded items set inside a scrolling viewport.  If this is the case, you can just repeat the simple button creation you did above, placing all the buttons in the appropriate places in your tall layout (on top of / next to each distinct "item" in the layout).


          If you're still using a Data List with a Repeated Item, then the initial setup will be a little bit more tricky, but it will save you time in the long run since you only have to set up one button (which will then be repeated for each item).  Here's how:


          1. Find the "dataProvider" tag in the code.
          2. Inside that will be a series of "Object" tags listing your current list data.  Add a new "url" attribute to each tag, e.g. url="http://www.adobe.com".
          3. Edit the Repeated Item's definition (in the source code, find the itemRenderer attribute on the List tag and ctrl+click it).
          4. Create your URL link button inside there. But -- instead of typing in the URL as a string in quotes (as seen in other examples in this forum), use data.url to refer to the url attribute you added in step 2.


          Hope that helps!


          - Peter

          • 2. Re: Design-Time Data with external url linking
            trancepriest Level 1



            I've switched back to using a data list and had it working with this method posted in the Flash Builder forum:



            I will attempt to do it the way you posted... my solution looks rather badly hacked together... even though it works :-)




            Another question is how do you add a useHandCursor to each data list item? I've placed the code in the <s: list and now even the vertical scroller has an hand pointer.

            • 3. Re: Design-Time Data with external url linking
              Peter Flynn (Adobe) Adobe Employee

              Glad to hear you got it working!  About the hand cursor, see my other reply here.


              - Peter