6 Replies Latest reply on Aug 5, 2011 10:32 AM by saisri2k2

    organize list items

    Log Home Level 1

      I have a list of items being returned on iOS from a remote httpService to an XML file.  Everything is working great and I'm having so much fun!

       

      The list contains about 300 entries which is too long to scroll through.

       

      How do I organize the list alphabetically like for example the 'Contacts' in iOS where you can click on letter 'D' for example in the vertical scroll bar and just get the 'D' entries.  How do I accomplish that in Flex 4.5.1.

       

      Also, after pushing to the detail view and then returning back to the main list view, how do I return to the exact place where I was when I popView() to the list rather than the top of the list when I return?  In other words when I go back I want to return to the same spot, say halfway through the list, and not the beginning of the list??

       

      Thanks,

      TuTone

       

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:s="library://ns.adobe.com/flex/spark" title="weather"
              creationComplete="getWeather.send()">
          <fx:Script>
              <![CDATA[
                  import mx.collections.ArrayCollection;
                  import spark.events.IndexChangeEvent;
                  import mx.rpc.events.ResultEvent;
                  import spark.events.IndexChangeEvent;
                  [Bindable]
                  protected var myWeather:ArrayCollection;
                 
                  protected function getWeather_resultHandler(event:ResultEvent):void
                  {
                      // TODO Auto-generated method stub
                      myWeather = event.result.RoadConditionsDetails.WeatherRoute;
                  }
                 
                  protected function weatherList_changeHandler(event:IndexChangeEvent):void
                  {
                      // TODO Auto-generated method stub
                      navigator.pushView(views.WeatherDetails,weatherList.selectedItem)
                  }
                 
              ]]>
          </fx:Script>
          <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
              <s:HTTPService url="http://www.cotrip.org/xml/road_conditions.xml"
                             id="getWeather"
                             result="getWeather_resultHandler(event)"/>
          </fx:Declarations>
          <s:navigationContent/>
          <s:List id="weatherList" change="weatherList_changeHandler(event)"
                  dataProvider="{myWeather}"
                  labelField="RouteName"
                  verticalScrollPolicy="on"/>
         
      </s:View>