Sort Items Alphabetically in List Control

Hi,
  I have a code snippet as in the following: (input is a dynamically generated array based on users selection)
  //Create a new List element
                      list1 = new List();              
                      var sort:Sort = new Sort();
                      sort.fields = [new SortField(null,true)];
                      input.sort = sort;  # 1168: Illegal assignment to function sort.
                      input.refresh();
                      list1.dataProvider = input;    
                      list1.setStyle("color","blue");     
                      list1.setStyle("borderStyle","none");
                      list1.labelField = "name";
                      list1.allowMultipleSelection = false;
                      list1.doubleClickEnabled = true;         
                      list1.addEventListener("change",updateNameSelected2); //Add Event Listener on single Click
                      list1.addEventListener("doubleClick",appointmentList2); //Add Event Listener on DoubleClick
  I don't think this seems to be legal, because I keep getting the error #1168 at the line where I marked input.sort= sort;
  I have a question here, when the list in Flex is generated, does it always show according to how the xml output is printed out, or does it generate the results printing alphabetically by default? If the former, why would I get the #1168 error, and how could I fix it?
Thanks in advance.
Alice

That's the expected behavior of the SortField, I don't think that 
using mix content you could accomplish what you want, remember the 
sorting order symbols, numbers, uppercase, lowercase.
Sincerely,
Michael
El 27/04/2009, a las 9:47, alice_data <[email protected]> escribió:
>
Hi, Mike:
>
  This is working so much better. But, I have one question, If I 
have something  like this, then the results get screwed up:
>
  abc-1m
  abc-101m
  abc-121m
>
  The output of the ordering:
>
  abc-101m
  abc-121m
  abc-1m
>
  Is this what the ordering is supposed to do? Or, is there 
something else I have done wrong here by applying your code 
directly? Here is the code:
>
    list1 = new List();  //Create a new List element
                      var col:ICollectionView = new 
ArrayCollection(input);
                      var sort:Sort = new Sort();
                      sort.fields = ;
                      col.sort= sort;
                      col.refresh();
                      list1.dataProvider = col;
                      list1.setStyle("color","blue");
                      list1.setStyle("borderStyle","none");
                      list1.labelField = "name";
                      list1.allowMultipleSelection = false;
                      list1.doubleClickEnabled = true;
                      list1.width = 200;
                      list1.height = 295;
list1.addEventListener("change",updateNameSelected2); //Add Event 
Listener on single Click
list1.addEventListener("doubleClick",appointmentList2); //Add Event 
Listener on DoubleClick
>
Thanks for your help.
>
Alice
>

Similar Messages

  • How to limit the number of items that a list control can hold?

    Hi,
    I am using a Flex3 List control for one of my projects.
    I add drag & drop functionality to it, so that i can drag & drop elements from one control to another.
    How to limit the number of items that a list control can hold / can be dropped in a list control ?
    - Sen.

    1. Listen for the dragdrop event on the control you are dragging onto.
    2. check the length of the items in the dataprovider - if it exceeds your maximum override the default drop action with e.preventDefault(); (assuming you used e for the event on the handler).
    Regards,
    Mark.

  • ContextMenu in List controls

    I have a context menu defined as such:
    _menu = new ContextMenu();
    _menu.hideBuiltInItems();
    this.menu = _menu;
    placed in the init method of a cell renderer. However, the
    normal context menu appears when right clicking on an item.
    I can place this same code on the main movie clip and it the
    updated context menu will display, but I only want it for the items
    in my list control.
    Is there any way to get a specific context menu to work on a
    specific movie clip which is a cell renderer in a list
    control?[

    Anybody?

  • How do I list items alphabetically in Finder when arranging items by Kind?

    I like the new look for the "arrange by Kind" option for Lion's Finder, except that when things are arranged by Kind, they're not listed alphabetically anymore. In fact, the way items are listed in each Kind category (Folders, PDF documents, etc.) doesn't seem to make any sense. For example, I have folders, PDFs, and Pages documents in my Documents folder. When I choose to "arrange by Kind" I get three separate lists for those three Kinds of items, but the arrangement of the items in those lists is completely random. The list of Folders isn't arranged by size, name, date opened, or anything in particular. Just Kind. So "arrange by Kind" is helpful in one way, but confusing in another.
    Any fix to this? It's a minor annoyance, but still something that shouldn't be.

    Press CMD J  This will bring up view options.  The options of Arrange by and Sort by are available.  Select Sort by name or other criteria.
    Regards,
    Captfred

  • How do we control who can approve items in a list?

    We are building a referral bonus list that needs to go through 4 levels of approval before being paid out.  I've created the workflow, but I can't figure out how to control who is allowed to approve it.  For example, it would be bad if an employee
    can enter the item, and then approve it as the Manager, Director and VP so that Finance gets notified and puts it on his check.
    How can I set it so that only management-level personnel are able to approve/reject specific items within the list?
    John

    Hi John,
    If you are using a custom list as referral bonus list, you can use the PowerShell to enable the option "Create items and edit items that were created by the user" (you
    can check if you need to set "Read items that were created by the user" ), then all users could only edit his own created items, then you grant "Manage lists" permission
    to Manager,Director and VP on this custom list and they will be able to view and edit all items.
    http://www.hersheytech.com/Blog/SharePoint/tabid/197/entryid/28/Default.aspx
    If you want only Manager, Director and VP to be able to approve/reject the Approval Workflow task items, you need to grant them Contribute permissions or higher on Workflow Tasks list, and remove all others' Contribute permissions.
    http://sharepoint.stackexchange.com/questions/35619/what-type-of-permission-user-needs-in-order-to-approve-workflow-task
    Thanks
    Daniel Yang
    TechNet Community Support

  • Full Control User Cannot View Items in a List

    Hi All,
    User wants to view items on 2 lists (List A/List B)
    I went ahead and inherited permissions the lists from the top level site.
    Lists A and B say Manage Exceptions because all the items in the list are unique items. 
    After all permissions were inherited I gave both user "full control". I hopped on to their account, and navigated the site and found out that when I click View All Site Content, I see both lists and the item count next to each list (indicating
    that there are items in List A/List B. When I click either list however, there are no items being displayed.
    Seems to me it has a lot to do with the unique items. How do I make all the unique items inherit parent permissions. When I try to do it, it makes me edit each item one-by-one. 

    Hi,
    Please firstly verify that the problematic user account has no sufficient permission on unique items. You could check item permission via Item’s “Share With” > Advanced > Check Permission:
    If you need to grant permission on all items to a user group in bulk, here is an article about granting a specific permission level to a single group for all uniquely secured items in a list:
    http://www.insource.com/sharing-with-sharepoint/
    Best regards,
    Sara Fan
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Payment Proposals list, needs to be sorted by alphabetically

    Every report needs to be sorted differently, but Payment Proposals list, needs to be sorted by alphabetically  listing
    pls provide solution

    Every report needs to be sorted differently, but Payment Proposals list, needs to be sorted by alphabetically  listing
    pls provide solution

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

  • Parameters to be sorted in alphabetical order

    Hi,
    Can you please let me know whether the parameters values are by default sorted in alphabetical order...refering to discoverer viewer/plus...
    Thanks in advance
    Sri

    If you are referring to the item classes (list of values), they would be sorted in alphabetical order. The parameter values wud appear in the same order in which the lovs appear in admin.
    If you want to customize the sorting (reorder), you can do so using alternate sort tab in edit item class.
    you can refer to the admin users guide.

  • How to get items from a list that has more items than the List View Threshold?

    I'm using SharePoints object model and I'm trying to get all or a subset of the items from a SharePoint 2010 list which has many more items than the list view threshold (20,000+) using the SPList.GetItems() method. However no matter what I do the SPQueryThrottledException
    always seems to be thrown and I get no items back.
    I'm sorting based on the ID field, so it is indexed. I've tried setting the RowLimit property on the SPQuery object(had no effect). I tried specifying the RowLimit in the SPQuerys ViewXml property, but that still throws a throttle exception. I tried using the
    ContentIterator as defined here:http://msdn.microsoft.com/en-us/library/microsoft.office.server.utilities.contentiterator.aspx,
    but that still throws the query throttle exception. I tried specifying the RowLimit parameter in the ProcessListItems functions, as suggested by the first comment here:http://tomvangaever.be/blogv2/2011/05/contentiterator-very-large-lists/,
    but it still throws the query throttle exception. I tried using GetDataTable instead, still throws query throttle exception. I can't run this as admin, I can't raise the threshold limit, I can't raise the threshold limit temporarily, I can't override the lists
    throttling(i.e. list.EnableThrottling = false;), and I can't override the SPQuery(query.QueryThrottleMode = SPQueryThrottleOption.Override;). Does anyone know how to get items back in this situation or has anyone succesfully beaten the query throttle exception?
    Thanks.
    My Query:
    <OrderBy>
        <FieldRef Name='ID' Ascending='TRUE' />
    </OrderBy>
    <Where>
        <Geq><FieldRef Name='ID' /><Value Type='Counter'>0</Value></Geq>
    </Where>
    My ViewXml:
    <View>
        <Query>
            <OrderBy><FieldRef Name='ID' Ascending='TRUE' /></OrderBy>
            <Where>
                <Geq><FieldRef Name='ID' /><Value Type='Counter'>0</Value></Geq>
            </Where>
        </Query>
        <RowLimit>2000</RowLimit>
    </View>
    Thanks again.

    I was using code below to work with 700000+ items in the list.
    SPWeb oWebsite = SPContext.Current.Web;
    SPList oList = oWebsite.Lists["MyList"];
    SPQuery oQuery = new SPQuery();
    oQuery.RowLimit = 2000;
    int intIndex = 1;
    do
    SPListItemCollection collListItems = oList.GetItems(oQuery);
    foreach (SPListItem oListItem in collListItems)
    //do something oListItem["Title"].ToString()
    oQuery.ListItemCollectionPosition = collListItems.ListItemCollectionPosition;
    intIndex++;
    } while (oQuery.ListItemCollectionPosition != null);
    Oleg
    Hi Oleg, thanks for replying.
    The problem with the code you have is that your SPQuery object's QueryThrottleMode is set to default. If you run that code as a local admin no throttle limits will be applied, but if you're not admin you will still have the normal throttle limits. In my
    situation it won't be run as a local admin so the code you provided won't work. You can simulate my dilemma by setting the QuerryThrottleMode  property to SPQueryThrottleOption.Strict, and I'm sure you'll start to get SPQueryThrottledException's
    as well on that list of 700000+ items.
    Thanks anyway though

  • How to get the value of a clicked item in a shuttle control

    I have a shuttle control (P8_SHUTTLE) that lists then names from scott.emp.
    Now I want to create a dynamic action that fires when I click on one of the names on the left side of the shuttle control.
    I want the dynamic action to recognize the name of the employee that was clicked, and then set the value of a text item (P8_LAST_VALUE) to that ename. (Eventually I want to display the department of that employee in the other text item).
    Here are screen shots of my DA:
    http://www.screencast.com/t/42klMC0Hbk
    http://www.screencast.com/t/Y5lZ4RsaLUI
    Currently, when I click an item in the shuttle control, the text item P8_LAST_VALUE remains blank.
    Thanks,
    Christoph

    Hi Christoph,
    you have to change your jQuery selector in the When section of the Dynamic action to #P8_SHUTTLE_LEFT.
    The shuttle item P8_SHUTTLE is build from to select lists P8_SHUTTLE_LEFT and P8_SHUTTLE_RIGHT.
    regards,
    Erik-jan

  • How can I alphabetized my list view in finder?

    How can I alphabetized my list view in finder?

    Hey orvil4388!
    Here is an article that can answer that question for you:
    OS X Mountain Lion: Choose options for viewing items in Finder windows
    http://support.apple.com/kb/PH10801
    Thanks for being a part of the Apple Support Communities!
    Cheers,
    Braden

  • Sorting items in a region with more than one column

    I have an item region that is set up to have 2 columns. When I sort by title, the items are re-sorted in alphabetical order from left to right and then down. This is not very intuitive. Is there a way to have it sort from top to bottom and then left to right so that they will be in order as you read down a single column? Right now my work around is to create two regions without banners side by side and then manually put the items in order. Thanks.

    hi,
    unfortunately you cannot change the sort order in a way that the items are first sorted down on the first column and then continued in second column.
    regards,
    christian

  • Issue in List Control

    I am facing a strange issue on the implementation of List Control on webdynpro ABAP UI screen . I have created a List Control where I have some buttons on the toolbar to perform some action. I am providing the data to the list .
    My issue now is when I select a line item on the first row of the List and click any of the buttons , no actions is getting triggered but works fine for the second row onwards. Can you please help in providing some suggestions?
    Thanks
    Ram

    Hi,
    For the First time, the lead selection is already set in the list control, hence the buttons are not getting triggered.
    You might have written the code inside the buttons only when there is a change in the slection of list.
    Regards,
    Lekha.

  • 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>

Maybe you are looking for

  • Missing Parts report for Purchase Orders

    Hey Gurus, We are running the availability check for Purchase orders and the user group is wondering if there is a standard Missing Parts report in SAP similiar to transaction CO24 for Purchase Orders so that they can view all of the Purchase orders

  • Problem with loadjava

    Hello, everytime i use the "loadjava" utility, to upload Java class files into my Oracle database, an error occurs. This is an example of the error-message: D:\Programme>loadjava -user test/test -oci8 -force JTest.class Error while retrieving errors

  • Can't access audiobooks

    iI can't find my audiobooks on iTunes. I have read that only one download is allowed. If we are paying full price for the book ( not cheap!) we should be able to access and download as often as we like. Other wise charge a rental similar to movies wi

  • Update server is not responding

    does anybody know why i get this message? it is not only with Fireworks but in all parts of my CS4 Design Premium... Thanks in advance for all the trouble! Regards, Robert

  • Cannot activate elements 12, no internet connection (software failure)

    I cannot activate both elements 12 Photoshop and premiere because the programm remains to say Connect to the internet, which I am.