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

horizontalScrollPosition of a TileList does not dispatch the correct value when liveScrolling is set to false

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK 3.3 (Release)
    • None
    • mx: TileList
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Consider the following code:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" height="100%" width="100%"
      creationComplete="handleCreationComplete()">

      <mx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;

      [Bindable] private var dummyData : ArrayCollection;

      private function handleCreationComplete() : void
      {
      dummyData = new ArrayCollection();
      for (var i:int = 0; i<2000; i++)

      { dummyData.addItem( "Data " + i ); }

      }
      ]]
      >
      </mx:Script>

      <mx:VBox height="100%" width="100%">
      <mx:Label width="100%" height="25" textAlign="center" text="Scroll:

      {tileList.horizontalScrollPosition}

      "/>
      <mx:TileList id="tileList" width="100%" height="100%" direction="vertical" selectable="false"
      horizontalScrollPolicy="on" verticalScrollPolicy="off" liveScrolling="false" columnWidth="100"
      dataProvider="

      {dummyData}

      " />
      </mx:VBox>
      </mx:Application>

      Steps to reproduce:
      1. Compile the above code
      2. Scroll Horizontally using the Scroll Bar
      3. Observe the value on the top of the screen

      Actual Results:

      The actual value is the previous horizontal scroll position

      Expected Results:

      The current horizontal scroll position

      Workaround (if any):

      The bug is located within ScrollControlBase.scrollHandler

      protected function scrollHandler(event:Event):void
      {
      // TextField.scroll bubbles so you might see it here
      if (event is ScrollEvent)

      { var scrollBar:ScrollBar = ScrollBar(event.target); var pos:Number = scrollBar.scrollPosition; var prop:QName; if (scrollBar == verticalScrollBar) prop = new QName(mx_internal, "_verticalScrollPosition"); else if (scrollBar == horizontalScrollBar) prop = new QName(mx_internal, "_horizontalScrollPosition"); dispatchEvent(event); if (prop) this[prop] = pos; }

      dispatchEvent dispatches the ScrollEvent which triggers the Binding update for horizontalScrollPosition, however _horizontalScrollPosition is not updated until the next line, hence the Binding update recieves the previous value

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: