Spark.List Control: right order in selectedItems

Hi there,
How can I get the right order from the selectedItemsArray?
The docs say:
"These Vectors contain a list of the selected indices and selected data items in the reverse order in which they were selected. That means the first element in each Vector corresponds to the last item selected."
But this is not correct. If you have a look in the example "Handling multiple selection in the Spark List control" at the end of
http://help.adobe.com/en_US/flex/using/WSc2368ca491e3ff923c946c5112135c8ee9e-7fff.html
you will see, that the order is switching around at every click you make to select an Item in the list.
Indeed the last selected item is the first item in the array, but the order of the other items is not forseeable...
My Problem:
I'm using a list control as an itemeditor in a datagrid. (BTW: Is there a way to use dropshadow on the control?)
The selectedItems are written to Database as a string in form of "firstselection : secondSelection : thirdSelection".
I also already tried to push the last selectedItem in an array on every change event and join this to a string at focusOut.
But that seems to be to late, because the datagridColums editorDataFiled doesn't take the the new values.
Maybe there are other events , which would be better to use?
Besides how to handle the prevoiuos selectedItems, which comes already from the db. The best would be, if they are already in the right order at the beginning of that array respectivelythe string. "prevSelectedItem1 : prevSelectedItem2 : newSelectedItem1 ..."
Another solution would be to have at least the first selectedItem to be the first Item in the string to be written to the db whether is already selected at the editbeginnig or complete new selections are made.
I hope its understandable, because I'm from Germany
Every help is welcome!
Thanks, Kalle!
            <mx:DataGridColumn headerText="Fliesenart" dataField="prd_art" resizable="false" width="300" editorDataField="artLiSelected"  >
                <mx:itemEditor >
                    <fx:Component>
                        <s:MXDataGridItemRenderer height="22" >
                            <fx:Script><![CDATA[
                                import mx.collections.ArrayCollection;
                                import mx.events.FlexEvent;
                                import spark.events.IndexChangeEvent;
                                [Bindable]
                                public var artLiSelected:String;
                                [Bindable]
                                public var artTempArr:Array = new Array();
                                public var artNewTempArr:Array = new Array();
                                protected function artLi_creationCompleteHandler(artStr:String):void
                                    artLiSelected = artStr;
                                    artTempArr = artStr.split(" : ");
                                    var artTempVec:Vector.<Object> = new Vector.<Object>();
                                    for each (var art:Object in artTempArr) {
                                        artTempVec.push(art);
                                    artLi.selectedItems = artTempVec;
                                protected function dataCollector():void {
                                    artNewTempArr.push(artLi.selectedItems[0]);
                                    //artLiSelected = artLi.selectedItems.join(" : ");
                                    trace ("change");
                                protected function dataSubmitter ():void {
                                    artLiSelected = artNewTempArr.join(" : ");
                                    trace ("focusOut");
                            ]]></fx:Script>
                            <s:List id="artLi" height="300" top="5" left="5" right="5"
                                    dataProvider="{outerDocument.artNamesArr}"
                                    change="dataCollector()"
                                    focusOut="dataSubmitter()"
                                    requireSelection="true"
                                     creationComplete="artLi_creationCompleteHandler(data.prd_art)"
                                    allowMultipleSelection="true"
                                    />
                        </s:MXDataGridItemRenderer>
                    </fx:Component>
                </mx:itemEditor>
            </mx:DataGridColumn>

Create your own list which must extend from spark.List and then override the function calculateSelectedIndices.
Then you can do 2 things depending on how you want the order in the selectedItems:
1. Change all the interval.splice to interval.push (now you have the normal order)
2. Change the "for (i = 0; i < selectedIndices.length; i++)" to "for (i = selectedIndices.length -1; i > -1; i--)" (then you have a reversed order)

Similar Messages

  • Custom dragIndicator on Spark List Control

    I have a Spark List Control that is displaying a tilelayout of dynamically imported Images.  Basically, a bunch of thumbnail Images that are displayed in a tile layout.  I have drag drop enabled so that I can reorder these thumbnails and everything is working great except for one thing, the dragIndicator.  In my itemrenderer, I have the Image included in the "dragging" state, but the image is not showing in the dragIndicator.  I am basically just getting a semi-transparent square as my dragIndicator, but I want to be able to actually drag my thumbnail.  Any ideas how to do this?
    Here is my List:
    <s:List id="ImageList1" x="77" y="95" width="858" height="412" dataProvider="{imageAC}"
         itemRenderer="renderers.ImageACSmallItemRenderer" contentBackgroundColor="0x000000"
         borderVisible="false" dragEnabled="true" dropEnabled="true" dragMoveEnabled="true"
         allowMultipleSelection="true" skinClass="skins.General.ListSkin" focusAlpha="0" mouseMove="getImageProxy(event)">
         <s:layout>
              <s:TileLayout columnWidth="76" rowHeight="76" horizontalAlign="center" verticalAlign="middle"
                     horizontalGap="8" verticalGap="8"/>
         </s:layout>
    </s:List>
    Here is my Itemrenderer:
    <fx:Script>
         <![CDATA[
              import mx.utils.ObjectProxy;
              [Bindable]
              public var dataProxy:ObjectProxy;
              private function init():void {
                   dataProxy = new ObjectProxy(data);
         ]]>
    </fx:Script>
         <s:states>
              <s:State name="normal" />
              <s:State name="hovered" />
              <s:State name="selected" />
              <s:State name="dragging" />
         </s:states>
         <mx:Image source="{dataProxy.pathSmall}" horizontalCenter="0" verticalCenter="0" includeIn="normal, hovered, selected, dragging"/>
    </s:ItemRenderer>
    Thanks for any insight!

    Hi Evtim,
    Earlier this summer, you helped me to create an itemRenderer that would allow me to drag photos in a list with a grid layout so that I could re-order them, and the dragIndicator would remain the photo instead of a empty box.  We accomplished this by using the contentCache feature with the Spark BitmapImage.  Now when I drag my photos, they remain photos even while being dragged.  Your very elegant solution ended up looking like this:
    <?xml version="1.0" encoding="utf-8"?>
    <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                                            xmlns:s="library://ns.adobe.com/flex/spark"
                                            xmlns:mx="library://ns.adobe.com/flex/mx"
                                            width="76" height="76" focusEnabled="false">
              <fx:Script>
                        <![CDATA[
                                  import spark.core.ContentCache;
                                  static private const contentCache:ContentCache = new ContentCache();
                        ]]>
              </fx:Script>
              <s:states>
                        <s:State name="normal" />
                        <s:State name="hovered" />
                        <s:State name="selected" />
                        <s:State name="dragging" />
              </s:states>
              <s:BitmapImage source="{data.pathSmall}" width="70" height="70" contentLoader="{contentCache}"
                                                horizontalCenter="0" verticalCenter="0" alpha.dragging="2" includeIn="normal, hovered, selected, dragging"/>
    </s:ItemRenderer>
    Now I have another little interesting challenge with this itemRenderer.  I don't want to bore you with details, but the situation is that I will no longer be loading thumbnails that are 70x70 pixels in size, but I will be loading photos with various dimensions that have to be displayed as a 70x70 pixel thumbnail.  So I am going to create a Group that is 70x70 pixels, turn on the clipAndEnableScrolling for the Group, and then place the photos within the Group so that they essentially get cropped.  The images that I import will have to be resized to either 70 pixels wide or 70 pixels high depending on what is the larger dimension of the of the image, and then placed inside the Group so that I get a perfect center-crop of the images.
    So to summarize, I need to load the photos using a loader.  Then I can figure out with the height and width of the photos is.  Then I can scale the photo so that the smaller dimension is 70 pixels, and then I can place it in the Group.  But to do all of this, I can no longer do it in MXML but have to do it in ActionScript... and thus my dilema.  I can't figure out how to use the contentCache properly in ActionScript so that the images stay images when dragged.  Here is what I have so far:
    <?xml version="1.0" encoding="utf-8"?>
    <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                                            xmlns:s="library://ns.adobe.com/flex/spark"
                                            xmlns:mx="library://ns.adobe.com/flex/mx"
                                            width="76" height="76" focusEnabled="false" dataChange="init(event)">
              <fx:Script>
                        <![CDATA[
                                  import mx.core.FlexGlobals;
                                  import mx.events.FlexEvent;
                                  import spark.core.ContentCache; 
                                  private var contentCache:ContentCache = new ContentCache();
                                  private var imageLoader:Loader = new Loader();
                                  private var bitmapImg:BitmapImage = new BitmapImage();
                                  private var widthHolder:int;
                                  private var heightHolder:int;
                                  protected function init(event:FlexEvent):void {
                                            var request:URLRequest = new URLRequest(FlexGlobals.topLevelApplication.imageAC[this.itemIndex].pathSmall);
                                            imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, createVisuals);
                                            imageLoader.load(request);
                                  private function createVisuals(event:Event):void{
                                            bitmapImg.source = Bitmap(imageLoader.content);
                                            bitmapImg.horizontalCenter = 0;
                                            bitmapImg.verticalCenter = 0;
                                            bitmapImg.smooth = true;
                                            bitmapImg.smoothingQuality = "high";
                                            widthHolder = imageLoader.width;
                                            heightHolder = imageLoader.height;
                                            if (widthHolder > heightHolder) {
                                                      bitmapImg.width = int(Math.round(70*widthHolder/heightHolder));
                                                      bitmapImg.height = 70;
                                            else {
                                                      bitmapImg.width = 70;
                                                      bitmapImg.height = int(Math.round(70*heightHolder/widthHolder));
                                            imageGroup.addElement(bitmapImg);
                        ]]>
              </fx:Script>
              <s:states>
                        <s:State name="normal" />
                        <s:State name="hovered" />
                        <s:State name="selected" />
                        <s:State name="dragging"/>
              </s:states>
              <s:Group id="imageGroup" width="70" height="70" horizontalCenter="0" verticalCenter="0" clipAndEnableScrolling="true"/>
    </s:ItemRenderer>
    So when there is a dataChange in my List, the init() function gets called to load the image.  When the load is complete, the createVisuals() method resizes the image and places it in the Group. Everything is working as expected.  The images get resized, centered and cropped within the group, and smoothed out so that they look nice.  But now when I drag them, I get an empty box while dragging.  I am unsure of how to tie in the contentCache with my bitmapImage object so that it will stay an image while being dragged using actionScript.  I don't know if it is as simple as setting the contentLoader property for the bitmapImage object, or if it is more complicated and I need to set the image source for the "dragging" state.  Could you possibly give me some insight as to how to make this happen in ActionScript?
    Thanks for any insight!
    Bill

  • How Do You Populate A Spark List Control With An Array?

    Hello, all,
    Sorry to come accross so frustrated, but how in the name of God do you populate a Spark list control with the data in an array?  You used to be able to do this with the mx:List control, but the guys developing Flex just had to make things more difficult than they need to be!  I am more of a code purist and prefer doing things the way they have been done for decades, but apparently nothing can ever stay simple!
    I simply want to populate a list control with an array and this shouldn't be rocket science!  I found out that I must use a "collection" element, so I decided that an arrayCollection would be best.  However, after searching Adobe's documentation about arrayCollections, I am lost in a black hole of data binding, extra lines of code just to add a new element, the need to sort it, etc...!
    Here is my code:
    var pendingArray:ArrayCollection = new ArrayCollection();
    for ( var i:int = 0 ; i < queue.length ; i++ )
         var item:UserQueueItem = queue[i] as UserQueueItem ;
         if ( item.status == UserQueueItem.STATUS_PENDING )
         pendingArray.addItem({label:item.descriptor.displayName,descriptor:item.descriptor});
    Here is the relevant MXML:
    <s:VGroup>
         <s:List id="knockingList" width="110" height="100"/>              
    </s:VGroup>
    I'm not getting any errors, but the list is not populating.
    I have seen several examples where the arrayCollection is declared and populated in MXML:
            <mx:ArrayCollection id="myAC">
                <!-- Use an fx:Array tag to associate an id with the array. -->
                <fx:Array id="myArray">
                    <fx:Object label="MI" data="Lansing"/>
                    <fx:Object label="MO" data="Jefferson City"/>
                    <fx:Object label="MA" data="Boston"/>
                    etc...
               </fx:Array>
            </mx:ArrayCollection>
    That may be fine for an example, but I think this is a rare situation.  Most of the time I would image that the arrayCollection would be created and populated on the fly in ActionScript!  How can I do this?
    Thanks in advance for any help or advice anyone can give!
    Matt

    In your post it seemed like you were trying to take care of many considerations at once: optimization, design, architecture.  I would suggest you get something up and running and then worry about everything else.
    If I use data binding, then I will probably have to declare the  arrayCollection as a global variable and then I'll have to write 100 or  so extra lines of code to addItem(), removeItem(), sort(), etc...  It  just seems like too much overhead.
    I believe you may have some misconceptions about databinding in general.  You won't have to make it a global variable and you certainly won't need an extra 100 lines of code.  If you did this forum would be a very , very quiet place.
    I don't want to use data binding because the original array is refreshed  often and there is one function called by an event that re-declares the  arrayCollection each time, populates it with the array, and then sets  it as the list's dataprovider.
    That is the beauty of the ArrayCollection, it can handle the updates to its source Array. I don't know if you need to redeclare the ArrayCollection, resetting the source to the new Array allows everyone involved to keep their references so you don't have to worry about any "spooky" stuff going on.

  • How to handle multiple selection in the Spark List control with checkbox as itemrenderer?

    Hi All,
    I am using checkbox as an ItemRenderer in spark list.
    I have a query.
    how to handle multiple selection in the Spark List control with checkbox as itemrenderer?
    how to retrieve the selected item label?
    Thank you in advance.

    Hi there, I'll tweak your code a little bit to something like this:
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    layout="vertical">
        <mx:Script>
            <![CDATA[
                 import mx.events.ListEvent;
                 import mx.controls.CheckBox;
               [Bindable]
               private var mySelectedIndexes:ArrayCollection=new ArrayCollection();
                private function onChange(e:ListEvent):void
                   if(CheckBox(e.itemRenderer).selected){
                             mySelectedIndexes.addItem(e.rowIndex);
                   }else{
                                  mySelectedIndexes.removeItemAt(mySelectedIndexes.getItemIndex(e.rowIndex));     
                   chkList.selectedIndices=mySelectedIndexes.toArray();
            ]]>
        </mx:Script>
    <mx:ArrayCollection id="collection">
            <mx:Object label="Test A"/>
            <mx:Object label="Test B"/>
            <mx:Object label="Test C"/>
            <mx:Object label="Test D"/>
            <mx:Object label="Test E"/>
            <mx:Object label="Test F"/>
            <mx:Object label="Test G"/>
        </mx:ArrayCollection>
    <mx:List id="chkList" dataProvider="{collection}" itemRenderer="mx.controls.CheckBox"  itemClick="onChange(event);" allowMultipleSelection="true"/>
    </mx:Application>

  • DataTipFields in Spark Lists?

    It doesn't seem like Spark's List controls are fully implemented;  at the very least dataTips and dataTipFields aren't.  This Halo code works:
    <mx:List id="courseCatalog" dataProvider="{getAllCoursesResult.lastResult}" labelField="title"  showDataTips="true" dataTipField="slug" ></mx:List>
    but the Spark version:
    <s:List id="courseCatalog" dataProvider="{getAllCoursesResult.lastResult}" labelField="title"  showDataTips="true" dataTipField="slug" ></s:List>
    yields these errors.
    Cannot resolve attribute 'dataTipField' for component type spark.components.List.   
    Cannot resolve attribute 'showDataTips' for component type spark.components.List.
    Is this a known issue?
    --Mike Jennings

    Correct, the mx:List and s:List components are two separate components and don't always have the exact same APIs. Most of the time the same functionality exists in both controls, but they may have slightly different names. I believe the latest Flex 4/ActionScript 3.0 Language Reference is posted at http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/ and should list which properties/methods/styles are supported by each component.
    As for your dataTip question, this may work for you: http://blog.flexexamples.com/2009/08/15/creating-data-tips-on-a-spark-list-control-in-flex -4/
    Not 100% certain about the variable row height, but I can take a look.
    Peter

  • How to search XML data from a HTTPMultiService and display the result on the Spark List

    Hello all,
    I am totally new to Flash Builder and Actionscript and hope someone might be able to help me out. I basically create a mobile app with a single view. The view has a TextInput as a search box and a search button. I conntected a Data/Service using a local XML file and bind the Data to a Spark List. Innitally the List will show nothing until the user enter the search term and hit the button. The List suppose to show the XML data that match the search term.
    Now is my problem. I cannot make the List to show the data that match the search text. The List just shows ALL the data.
    Here are my MXML code:
    <?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"
            xmlns:shopping="services.shopping.*"
            title="Search">
        <fx:Script>
            <![CDATA[
                import mx.events.FlexEvent;
                protected function button1_clickHandler(event:MouseEvent):void
                    navigator.popView();
                protected function list_creationCompleteHandler(event:FlexEvent):void
                    getDataResult.token = shopping.getData();
                protected function seach_clickHandler(event:MouseEvent):void
                    getDataResult.token = shopping.getSearchData(searchTxt.text);
            ]]>
        </fx:Script>
        <fx:Declarations>
            <s:CallResponder id="getDataResult"/>
            <shopping:Shopping id="shopping"/>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <s:actionContent>
            <s:Button height="79" label="Back" click="button1_clickHandler(event)"/>
        </s:actionContent>
        <s:List id="list" left="0" right="0" top="111" bottom="0"
                creationComplete="list_creationCompleteHandler(event)" labelField="english">
            <s:AsyncListView list="{getDataResult.lastResult}"/>
        </s:List>
        <s:TextInput id="searchTxt" x="80" y="34" width="250" height="49" enabled="true"
                     prompt="search..."/>
        <s:Button id="search" x="338" y="35" width="72" height="49" label="s"
                  click="seach_clickHandler(event)"/>
    </s:View>
    Here is the _Super_Shopping.as file:
    * This is a generated class and is not intended for modification.  To customize behavior
    * of this service wrapper you may modify the generated sub-class of this class - Shopping.as.
    package services.shopping
    import com.adobe.fiber.core.model_internal;
    import com.adobe.fiber.services.wrapper.HTTPServiceWrapper;
    import com.adobe.serializers.xml.XMLSerializationFilter;
    import mx.rpc.AbstractOperation;
    import mx.rpc.AsyncToken;
    import mx.rpc.http.HTTPMultiService;
    import mx.rpc.http.Operation;
    import valueObjects.Shop;
    [ExcludeClass]
    internal class _Super_Shopping extends com.adobe.fiber.services.wrapper.HTTPServiceWrapper
        private static var serializer0:XMLSerializationFilter = new XMLSerializationFilter();
        // Constructor
        public function _Super_Shopping()
            // initialize service control
            _serviceControl = new mx.rpc.http.HTTPMultiService();
             var operations:Array = new Array();
             var operation:mx.rpc.http.Operation;
             var argsArray:Array;
             operation = new mx.rpc.http.Operation(null, "getData");
             operation.url = "assets/data/shopping.xml";
             operation.method = "GET";
             operation.serializationFilter = serializer0;
             operation.properties = new Object();
             operation.properties["xPath"] = "/::shop";
             operation.resultElementType = valueObjects.Shop;
             operations.push(operation);
             operation = new mx.rpc.http.Operation(null, "getSearchData");
             operation.url = "assets/data/shopping.xml";
             operation.method = "GET";
             operation.resultFormat = "text";
             argsArray = new Array("item");
             operation.argumentNames = argsArray;
             operation.properties = new Object();
             operation.properties["xPath"] = "/::shop";
             operation.resultElementType = valueObjects.Shop;
             operations.push(operation);
             _serviceControl.operationList = operations;
             preInitializeService();
             model_internal::initialize();
        //init initialization routine here, child class to override
        protected function preInitializeService():void
          * This method is a generated wrapper used to call the 'getData' operation. It returns an mx.rpc.AsyncToken whose
          * result property will be populated with the result of the operation when the server response is received.
          * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value.
          * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
          * @see mx.rpc.AsyncToken
          * @see mx.rpc.CallResponder
          * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
        public function getData() : mx.rpc.AsyncToken
            var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getData");
            var _internal_token:mx.rpc.AsyncToken = _internal_operation.send() ;
            return _internal_token;
        public function getSearchData(item:String) : mx.rpc.AsyncToken
            var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getSearchData");
            var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(item);
            return _internal_token;
    The getSearchData() supposed to return XML data that match the search text, but it doesn't. Can anyoen help?
    Thank you!

    Hi,
    are you able to change dynamically the  operation.url = "assets/data/shopping.xml";?
    i need to do that based on the users input.
    Thanks in advance,

  • Extending a component which already extends a spark list ItemRenderer

    Hello everyone,
    I have the following situation: Im displaying lists of very similar data objects (they extend the same parent) so in order to avoid a lot of changes to many itemrenderers (if i need to change something in the common properties) when displaying this data, i defined a spark list ItemRenderer (in MXML) which displays the common properties (file called BaseRenderer.mxml):
    <s:ItemRenderer>
         //in the script section i override the set data property
         //some MXML labels, checkboxes, etc
    </s:ItemRenderer>
    Then i created a specific itemrenderer which extended it (file SpecificRenderer.mxml):
    <model:BaseRenderer>
         //again i override the set data property
         //some ADITIONAL MXML labels, checkboxes, etc
    </model:BaseRenderer>
    When i run the app, and when the specific renderer is used, it works (no errors are thrown) , but it only shows the content of specific renderer, nothing from base renderer is visible. Is this the right way to do this, or do i have to override some additional stuff in my specific renderers?
    Thank you.
    One more thing, i just noticed, if i remove all MXML tags from specific renderer, the content from base renderer becomes visible, seems as if specific content overrides base content. Is there a way to add mxml tags into the specificrenderer?

    Yes i suspected them to be merged, and you gave me a great idea. As you say this behavior is true across all mxml defined components, not just itemrenderers. I want to avoid actionscript renderers because i dont (and wont) have any performance issues anyway and i like flexibility in design view, so instead i found another solution which i slightly modified. Some spark components inherit property mxmlContent, which you can override. This is what i came up with in the end: I added the property override into specific renderer and everything is shown as expected (because base elements are merged with the ones from extended component).
    override public function set mxmlContent(value:Array):void {
                                            var adding:Boolean = true;
                                            var index:int = 0;
                                            while (adding) {
        var element:IVisualElement = null;
        try {          element = super.getElementAt(index); } catch(e:Error) {          }
        if ( element != null )  {
           value.push(element);
           index += 1;
        else
          adding = false;
                                            value.reverse();
                                            super.mxmlContent = value;

  • Spark list horizontal scroller doesn't actualize when rows is set lesser than list container

    Hello,
    The size of the Image control is set larger than that of its parent Group  container. By default, the child extends past the boundaries of the parent  container. Rather than allow the child to extend past the boundaries of the  parent container, the Scroller specifies to clip the child to the boundaries and  display scroll bars.
    In the spark list, when I change the list dataProvider and the size of the Image control is set lesser than that of its parent Group  container, the horizontal scroller doesn't actualize.
    thanks.

    <!-- Simple example to demonstrate the Spark List component -->
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" applicationComplete="comp()" width="260" height="400">
        <fx:Script>
            <![CDATA[
        import mx.collections.*;
        public var dpArray:Array;
        [Bindable]
        public var dpCol:ArrayCollection;
        public function handleClick():void {
            dpCol.removeAll();
            dpCol.addItem({ label:"spark test" });
            dpCol.addItem({ label:"spark text" });
        public function comp():void {
            dpCol = new ArrayCollection(dpArray);
            dpCol.addItem({ label:"spark list horizontal scroller doesn't actualize when rows is set lesser than list container" });
            dpCol.addItem({ label:"spark test" });
            dpCol.addItem({ label:"spark text" });
             ]]>
        </fx:Script>
        <s:Panel title="List">
            <s:VGroup left="20" right="20" top="20" bottom="20">
                <s:List width="200" id="lis" dataProvider="{dpCol}" height="120"/>
                <s:Button id="button1" label="Click here!" width="100" fontSize="12" click="handleClick();"/>
            </s:VGroup>
        </s:Panel>
    </s:Application>

  • Spark list filter not working

    I have a spark list with custom itemRenderers and I have a filter on the list.  I run the filter, but at random times the filter doesn't work. I threw in some trace statements and its passing the filter but the screen doesn't show the filters results. It only shows the results of the last filter. I think it has to do with the spark lists itemRenderer resuse.
    Is this a known bug?

    The bug is in TileLayout. 
    If I remove the the TileLayout the list functions as aspected.  Here is a simple example.  Make sure when running the app to follow these instructions.
    1. Run the app (notice the list shows all the items in it)
    2. Click "K"
    3. Click "All"
    4. Look at the Bottom list to see if only two items show even when "ALL" is selected.
    5.Repeat steps 2-4 until you see the bug.
    <?xml version="1.0" encoding="utf-8"?>
    <!-- http://blog.flexexamples.com/2010/05/12/scrolling-to-a-specific-index-in-a-spark-list-cont rol-in-flex-4/ -->
    <s:Application name="Spark_List_ensureIndexIsVisible_test"
       xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    private var array:Array = ['one', 'otwo', 'othree', 'ofour', 'ofive', 'osix', 'oseven', 'oeight', 'nine', 'nten'];
    private var myAC:ArrayCollection = new ArrayCollection( array );
    private function setAlphaFilter() : void {
    if( myAC ) {
    myAC.filterFunction = alphaFilter;
    myAC.refresh();
    private function alphaFilter( item:Object ) : Boolean {
    var tempStr:String;
    if( String(alphaList.selectedItem.firstName).toLowerCase() == 'all' ) {
    return true;
    if(  item.toLowerCase().charAt(0) == String(alphaList.selectedItem.firstName).toLowerCase() ) { // if something a letter is selected.
    return true;
    return false;
    ]]>
    </fx:Script>
    <s:List id="alphaList" changing="setAlphaFilter()"
    width="100%" top="2" bottom="2" left="2" right="2" borderColor="#7F7F7F" >
    <s:layout>
    <s:HorizontalLayout columnWidth="20" paddingLeft="1" />
    </s:layout>
    <!-- itemRenderer is inline in this sample -->
    <s:itemRenderer>
    <fx:Component>
    <s:ItemRenderer>
    <s:Group top="1">
    <s:Label id="blah" text="{data.firstName}" fontSize="13" bottom="1" top="1" right="1" left="1" />
    </s:Group>
    </s:ItemRenderer>
    </fx:Component>
    </s:itemRenderer>
    <s:dataProvider>
    <s:ArrayList>
    <fx:Object firstName="All" />
    <fx:Object firstName="A"  />
    <fx:Object firstName="B"  />
    <fx:Object firstName="C" />
    <fx:Object firstName="D" />
    <fx:Object firstName="E" />
    <fx:Object firstName="F"  />
    <fx:Object firstName="G"  />
    <fx:Object firstName="H" />
    <fx:Object firstName="I" />
    <fx:Object firstName="J" />
    <fx:Object firstName="K"  />
    <fx:Object firstName="L"  />
    <fx:Object firstName="M" />
    <fx:Object firstName="N" />
    <fx:Object firstName="O" />
    <fx:Object firstName="P"  />
    <fx:Object firstName="Q"  />
    <fx:Object firstName="R" />
    <fx:Object firstName="S" />
    <fx:Object firstName="T" />
    <fx:Object firstName="U"  />
    <fx:Object firstName="V"  />
    <fx:Object firstName="W" />
    <fx:Object firstName="X" />
    <fx:Object firstName="Y" />
    <fx:Object firstName="Z" />
    <fx:Object firstName="1" />
    <fx:Object firstName="2" />
    <fx:Object firstName="3" />
    <fx:Object firstName="4" />
    <fx:Object firstName="5" />
    <fx:Object firstName="6" />
    <fx:Object firstName="7" />
    <fx:Object firstName="8" />
    <fx:Object firstName="9" />
    </s:ArrayList>
    </s:dataProvider>
    </s:List>
    <s:List id="list" width="630" height="100"
    horizontalCenter="0" verticalCenter="0" dataProvider="{myAC}" useVirtualLayout="true" allowMultipleSelection="true">
    <s:layout>
    <s:TileLayout columnWidth="300" rowHeight="50" verticalGap="1" horizontalGap="1" 
      requestedColumnCount="2"  />
    </s:layout>
    </s:List>
    </s:Application>

  • Artists beginning with The arent displayed in "right" order

    When using german as language setting, in iTunes 7+ groups beginning with "The" arent listed in the "right" order. That means The Beatles are shown with other Artists beginning with T instead of the ones with B.
    Instead, Artists beginning with "Die", the german word for "The" are now shown in "right" order.
    This second is a nice feature, but the first is far more neccessary. Does anybody know to which contact at apple i may complain about this behaviour?
    Regards, Illusion
    iBook G4   Mac OS X (10.3.9)  

    When using german as language setting, in iTunes 7+
    groups beginning with "The" arent listed in the
    "right" order. That means The Beatles are shown with
    other Artists beginning with T instead of the ones
    with B.
    Instead, Artists beginning with "Die", the german
    word for "The" are now shown in "right" order.
    To correct this in 7.1, just use the "Artist Sort" field.
    1) Get Info on a track by The Beatles.
    2) Select the Sorting tab.
    3) Enter "Beatles" into Artist Sort.
    4) Exit the info window and control-click the track.
    5) Select Apply Sort Field > Same Artist.
    This will copy "Beatles" into the Artist Sort field for all tracks by "The Beatles". They should then appear under B.

  • List of open orders

    Hi Guys,
    How to get list of open orders in table??

    try out VA05.
    if it is sales office level information, is required then you can have the sales office column added using the available layout options in VA05.
    if the sales man is marked under partner function, then you may need to extract the VA05 output & filter the sales order using VBPA table with parameters of sales man controlled in the selection screen.
    rgds
    ilango

  • I have multiple email accounts on my iPad. How do I control the order in which the accounts are displayed?

    I have multiple email accounts on my iPad. How do I control the order in which the accounts are displayed?

    In landscape mode, the mailbox list is automatically displayed (in portrait mode, you will need to tap the button to,show it).
    To edit the list, tap edit as shown below.

  • Is it possible to control the order that text flows appear when using them as text insets?

    I want to create multiple flows in a FrameMaker file which I can then insert as text insets. I would like to choose the inset using the Body Page Flow: dropdown list. However, there seems to be no order, alphabetical or otherwise, in which these flow appear in the drop down list. Is it possible to control this order, or is there a particular reason it appears the way it does?
    Cheers,

    IIRC, the flows are displayed in the order that they were created.

  • HT1660 My itunes library has automatically started to list my songs alphabetically.  I do not want this.  How do I change it so that when albums come up, the songs are listed in the order of the imported album, NOT alphabetically.

    My itunes library has automatically started to list my songs alphabetically.  I do not want this.  How do I change it so that when albums come up, the songs are listed in the order of the imported album, NOT alphabetically.

    For the missing Artists on your iPod, make sure their tracks in iTunes are not marked as "Part of a compilation" in iTunes. You can do this by highlighting the track, right->clicking on them and choosing "Get Info" from the shortcut menu. When the window pops up, head over to the Info tab and make sure there is NO tick mark next to this option in the lower right hand corner. Lastly, sync the updated changes to your iPod.
    B-rock

  • How can I control the order of playback on MuVu Mix (USB 2.

    What determines the order of playback of music files stored on the MuVu Mix (USB 2.0)? How can I control the order?
    Apparently it is not name order. The music titles are prefixed by sequential numbers. But that is not the order that the files play back.
    I tried erasing all contents, then copying the files one by one to the MuVo Mix in the order that I want them to play back (name order). But that is not the order that the files play back.
    By the way, in both case, I removed the ".dat" file first. (I also tried keeping the ".dat" file, to no avail.)

    SSR wrote:
    > on the newer MuVos (which I would have thought included the Mix)
    > it's filename order. Other than that it's hard to know, but it sounds
    > like you ought to contact Support to check.
    I did, and they confirmed (very quickly; kudos!) what you and I both expect: the play order is determined by the alphabetical order of the file names. The mistake was mine. I ass-u-me-d that the MSWin folder "Name ^" order was correct. I did not realize that it is not exactly alphabetical when the file name begins with a number (e.g, the track number). I had renumbered songs from a second CD by simply adding 00 to the track number. Thus, songs and 2 of the first CD are played after songs 08 and 09 of the second CD, as they should alphabetically, even though they appear in the order , 2, 08, 09 in the "Name ^" list. Klunk! Mea cupla!

Maybe you are looking for

  • Error code -36

    Hi there, I'm encountering the following problem when attempting to trash or move files from a drive in an external FW800 enclosure: The Finder cannot complete the operation because some data in "folder name" could not be read or written. (Error code

  • Adobe form -- Issue in Displaying Dynamic text along with Static text

    Hi All, I am having an issue when i am displaying a dynamic text along with static text in adobeforms. The dynamic text is slightly coming down and not aligned with the static text. i can see half row it is coming down. how to align both texts to be

  • Low disk space Applescript (AppleEvent handler error -10000)

    Hello, I am new to Applescript, downloaded script from online for low disk space alert and was working properly on one mac but getting error on another mac of same version. Someone please help me on this. Thanks in advance. -- Script to warn users of

  • How to use Java Embedding activity, getting error

    Below is a simple code where in I am just assigning input variable to output variable(of type long), using java embedding activity, and I am getting error in Java Embedding Activity step. <bpelx:exec name="Java_Embedding_1" language="java" version="1

  • MS SQL Server 2000 JDBC files

    Hi, Im trying to get my java program to connect to MSSQL but the drivers dont want to work. Basically what I did is installed the drivers from MS, and also tried to set Classpath to C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\ But