Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-13749

TileBase::scrollToIndex causes RTE if called before list data is initialized

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • Adobe Flex SDK Previous
    • None
    • mx: TileList
    • None
    • Affected OS(s): All OS Platforms
      Browser: Firefox 2.x
      Language Found: English

    Description

      Steps to reproduce:
      1. Run attached test case TileBaseBug.mxml.

      Actual Results:
      Runtime error occurs in TileBase::scrollToIndex:
      -----------------------------------------------------------------------
      TypeError: Error #1010: A term is undefined and has no properties.
      at mx.controls.listClasses::TileBase/scrollToIndex()
      at TileBaseBug/createChildren()
      at mx.core::UIComponent/initialize()
      at mx.core::Container/initialize()
      at mx.core::Application/initialize()
      at TileBaseBug/initialize()
      at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::childAdded()
      at mx.managers::SystemManager/initializeTopLevelWindow()
      at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()
      -----------------------------------------------------------------------

      Expected Results:
      No runtime error, list is scrolled only by as much as there is data (or not as all, since the list data is not there yet).

      Workaround 1:
      Ensure that the list is fully initialized before calling scrollToIndex for the first time.

      Workaround 2:
      Use code similar to attached HorizontalListWorkaround.as to fix the specific TileBase-derrived class you want to use.

      Workaround 3:
      Move the "list.scrollToIndex(_data.length-1);" code to the HorizontalList control's creationComplete event handler. For example:
      [ActionScript]
      override protected function createChildren():void {
      super.createChildren();
      }
      [/ActionScript]

      [MXML]
      <mx:HorizontalList id="list" dataProvider="{_data}" columnCount="3" columnWidth="50" rowHeight="50" minHeight="70" creationComplete="list.scrollToIndex(_data.length-1);">
      ...
      </mx:HorizontalList>
      [/MXML]

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: