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

    LinkBar defaultButton

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




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



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

        • 1. Re: LinkBar defaultButton
          Peter deHaan Level 4

          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:
          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.