1 Reply Latest reply on Mar 4, 2008 1:59 PM by Peter deHaan

    LinkBar defaultButton

    HyderAlamgir Level 1
      I want to set the first item of the linkbar as the defaultButton for the parent form.

      e.g.

      <mx:Form>

      <mx:LinkBar>

      <mx:dataProvider>
      <mx:Object label="Login" />
      <mx:Object label="Cancel" />
      </mx:dataProvider>

      </mx:LinkBar>

      </mx:Form>

      How do i set the login button as the defaultButton for the form?


      Thanks
        • 1. Re: LinkBar defaultButton
          Peter deHaan Level 4
          Hyder_m29,

          I don't believe you can set the selectedIndex of a LinkBar control if you're using an array of objects/strings as a data provider. Although you could set the selectedIndex if you were using a ViewStack as a data provider or used a ToggleButtonBar control instead of a LinkBar.

          According to an engineer:
          [quote]
          Actually, the original design of LinkBar was that it kept track of the last selected link only if the LinkBar was bound to a ViewStack as its dataProvider. A LinkBar bound to an Array-based dataProvider would not keep track of the last selected link visually or programmatically (ie: selectedIndex would not update) because it was considered a grouping of stand-alone links. ButtonBar operates the same way.
          [/quote]

          Peter