Reverse the order of XML DataModel

I have the code loading items from an RSS feed below. The items are inserted in the reverse order. The attribute sortedAscending did nothing to help. How can I reverse the order in the listview?

GroupDataModel {
            id: articlesDataModel
            grouping: ItemGrouping.None
        },

        // The data source that fills the above model with the articles
        DataSource {
            id: articlesDataSource
            source: ""
            query: "/rss/channel/item"
            type: DataSource.Xml
            onDataLoaded: {
                articlesDataModel.clear();
                articlesDataModel.insertList(data);
            }
        },

The problem was with ListView. GroupDataModel returns itemType "item", but ArrayDataModel returns itemType empty by default, so I added this function to the ListView to substitute itemType:

ListView {
                    id: articlesListView
                    dataModel: articlesDataModel                    function itemType(data, indexPath) {
                        return "item" // use ListItemComponents of type 'item' for every item
                    }

Another option is to detach type: 'point' of ListItemComponent when using ArrayDataModel if you do not plan to use different item types.

In the data source:

            onDataLoaded: {
                myIndicator.stop();
                articlesDataModel.clear()
                for(var i = 0; i < data.length; ++i)
                {
                    print("data[i]=" + data[i])
                    articlesDataModel.append(data[i])   // or .insert(0, data[i]) to reverse the order
                }
                articlesListView.visible = true;
            }

Model:

        ArrayDataModel {
            id: articlesDataModel
            //grouping: ItemGrouping.None
        },

Tags: BlackBerry Developers

Similar Questions

  • How to reverse the order of my playlist @iTunes?

    Thus, with the new look of iTunes I can't figure out how to reverse the order of my playlist.

    I want to sort by 'love' or 'play' and have the most times (or the songs of love-labeled) on top (so number 1) and the less at the bottom of my reading list.

    For some reason any the only order plays mostly / marked love is at the bottom of the playlist and the parts less / unmarked is upstairs. Can't reverse this order. Reading order is normal (so after 1 is 2, etc.)

    How can I accomplish this?

    All my software is up-to-date.

    Thank you!

    To reverse the sort order of the list of songs, click on the header of the column used to sort again.

  • Can I reverse the order of the images in my image file?

    I am constantly sending pictures over the internet.  I use OS X on my Mac mini.  When I go to my image file, it lists all my images stored by oldest images first.  I have to scroll LIKE NEVER to get recent pictures... those I'm most likely to use.  Can I reverse the order so that the most recent images show first; Save me time in research?  Thanks advance.

    If I go into my pictures folder in the Finder and use the display of the list, I can click on the column modified date to sort normally or inverse. The ^ symbol will change with the sort order

  • How can I reverse the order of my slide show thumbnail images?

    I have a slideshow with the photos that I created using the lightbox widget, and I add new images of this weekly slideshow. It would be nice if the latest images could be at the top (first) and the older images at the bottom (last). However, to add a new image automatically finally puts online. I know how to drag to rearrange the images, but it is extremely tedious. I want to be able to reverse the order.

    Unfortunately, there is not currently in an automatic way to reverse the order of a slide show. However, when you add new images, adding them makes it after whatever the image is active in Design mode of Muse. If you select your first tile, and then import the additional images via the Options of the Widget, the new images will be inserted immediately after the first image. You can then move this first thumbnail image after the thumbnails for newly imported images and the result would be that new images would be at the beginning of your slide show.

  • Reverse the order of the pages

    I know that you can reverse the order of the pages when printing from InDesign (via the "General" of the print dialog box options), but is there a quick and easy access (No-3 rd party plug-ins or script) to reverse the order of the pages in Acrobat DC.

    On the search for other answers. MVP said he would never need to do this, but here in the country of Wales, UK we have Welsh language and English and we produce a lot of bilingual documents, often with a single language reversed and turned to compensate for a half of a booklet.

    I created a free utility that allows you to do this with a single click in Acrobat: Scripts custom Adobe: Acrobat - reverse the order Page (FREE)

  • Reverse the order of the layers it please?

    I have 30 layers I need to reverse the order from bottom to top.

    I have to do this one x one?  Why might bother youy say?

    Well, if you have multiple mixture of development plans, and it makes a

    bad job, you have to make repairs and do it from far away

    focus on aircraft, for the closest turns be sensitive.

    Will this make?

    Select your layers, and layers - organize - reverse

  • Reverses the order of the pages of Word to PDF

    When I create a PDF from an existing Word document it scans the pages in reverse order so that I see the second page first.  How can I fix it?  I have Word 2000 and Acrobat 9 Standard.  Any help will be much appreciated.

    In Word under Tools > Options > print tab, make sure that "Reverse the order of characters" is not checked.

  • reverse the order of a string.

    Hello

    I want to reverse the order of the string, as shown below
    14840/14867/14878 to  14878/14867/14840
    
    tried to do this but it was reverse the number along with string .
    
    select reverse('/14840/14867/14878') from dual
    
    87841/76841/04841/
    Thanks in advance

    Hello

    One way is to penetrate the chain its parts/delimited, then re - combine in reverse order, by using the aggregation of the string:

    WITH   got_part_cnt AS
    (
         SELECT     id
         ,     txt
         ,     1 + LENGTH (txt)
                - LENGTH (REPLACE (txt, '/'))     AS part_cnt
         FROM    table_x
    )
    ,      cntr    AS
    (
         SELECT     LEVEL     AS n
         FROM     (
                  SELECT  MAX (part_cnt)  AS max_part_cnt
                  FROM    got_part_cnt
              )
         CONNECT BY     LEVEL     <= max_part_cnt
    )
    SELECT     p.id
    ,     p.txt
    ,     LTRIM ( SYS_CONNECT_BY_PATH ( REGEXP_SUBSTR ( p.txt
                                                  , '[^/]+'
                                      , 1
                                                  , p.part_cnt + 1 - c.n
                                      )
                            , '/'
                            )
               , '/'
               )          AS new_txt
    FROM     got_part_cnt     p
    JOIN     cntr          c     ON     c.n     <= p.part_cnt
    WHERE     CONNECT_BY_ISLEAF     = 1
    START WITH     c.n     = 1
    CONNECT BY     c.n     = PRIOR c.n + 1
         AND     p.id     = PRIOR p.id
    ;
    

    This assumes that you have a table such as:

    CREATE TABLE     table_x
    (      id     NUMBER (4)          PRIMARY KEY
    ,      txt     VARCHAR2 (100)
    );
    

    If txt (the string to be converted) is unique, so you don't need any id.

    As written the request presupposes txt never empty rooms (i.e. two or many/s in a row, such as "part 1 / / / part 4"). The regular expression is a little more complicated if you need allow empty items.

    Whenever you post a question, understand what version of Oracle you are using. If you are using Oracle 10, you don't want a solution that builds on the features of Oracle 11, but if you use Oracle 11, you want to take advantage of these new features. The query above works in Oracle 10 (and), but it could be simplified in Oracle 11, using the new REGEXP_COUNT function.

  • OfficeJet 8600, reverse the order of characters, Windows 7

    I am running windows 7 64 bit, I don't find any option to print in reverse order. I want to print last page 1 and the 1st last page, there is thus in order after printing...

    .. under Printer preferences or properties of the printer, I tried all the options open and see nothing on the reverse print order

    Hi Jamin21,

    You need to change the order of pages. I would like to know if it works?

  • can someone tell me how to reverse the order of the bits of a .hws file?

    I have a (digital) .hws file that is backwards.  I need to exchange the LSB and MSB to reverse the reading order.  Can someone tell me how to do this?


  • How to reverse the order of the Pages in Acrobat Pro ms

    Old problem but the Javascripts there do not work for me and the whole implementation of scripting in Acrobat Pro MS became more difficult.

    I have books that are crawled back to the front so the PDF on page 300 of the book is page 1 of the PDF and 300 of the PDF page is page 1 of the book

    I just need to select all the pages and reverse their order. But this doesn't seem to be an option in one of the tools for editing, organization of a page.

    Javascripts out there used to add a menu item in the menu "Documents":

    app.addMenuItem ({cName: "Opposite Page", cParent: "File", cExec: 'PPReversePages();', cEnable: 'event.rc = (event.target!}) (= null); ', NPO: 0

    });

    function PPReversePages()

    {

    var t = app.thermometer;

    t.Duration = this.numPages;

    t.Begin ();

    for (i = this.numPages - 1; i > = 0; i)

    {

    t.Valeur = (i - this.numPages) *-1;

    this.movePage (i);

    t.Text = "Moving page" + (i + 1);

    }

    t.end ();

    } / / JavaScript Document

    but I can't find any way to run this script...

    NO.... I went to

    Support/Adobe/Acrobat ~users/mydrive/application

    and there is no "JavaScript" folder there... I made one, put it in the script and restart Acrobat: 'Nada' nothing.

    But back on the web and research: I found this solution that works.

    In Acrobat Pro DC go to

    1. Tools--> [scroll all the way down]-->
    2. Customize-->
    3. Action Wizard-->
    4. New Action--> [scroll the left panel under "choose tools to add :-->
    5. More tools-->
    6. Run JavaScript-->
    7. the new action appears on the right panel-->
    8. "Set your default values: let him-files to process--> file currently open by default.
    9. Under the "execute Javascript", click on-->
    10. Specify the parameters (why he didn't say "Enter your Script"?)
    11. another panel inaugurates his... paste this script:
    12. for (var i = this.numPages - 1; i > = 0; i--) this.movePage (i);
    13. Click OK to close and then save the action...
    14. Asked to name the action,
    15. Name it 'Reverse the Page order' and save...
    16. New action now appears in the action list Wizard Actions "reverse the Page order.

    It works!

    In my humble OPINION of older versions of Acrobat had a menu scripts at the top of the screen, right, totally accessible.

    Of course if you were not 'in' JS you can ignore it... But if you * use scripts *, he is not buried.

    This new UX is one of the worst imaginable scenarios.

    Maybe the Acrobat team has lost it's top UX people?

  • Reverse the order of loading Datagrid

    Currently, I have a datagrid loading data from a database of MySQL via PHP & ZendAMF. I need to show the last lines first (reverse order, row 1-> the last r & r-> First Row dern).

    Any suggestions?

    Why not just add a 'ORDER BY DESC' to your sql statement

    $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename LIMIT ?, ?");
    

    Doesn't look like it does any sort now.

    Is it all right to come out in the order of entry?

  • How to reverse the order "always open this page in Internet Explorer'?

    Recently, I said Firefox always open a web page with Internet Explorer. Now, I want to reverse this command; HWO can I do this?

    Check the options of the extensions that you use to open a page in Internet Explorer in tools > Modules > Extensions

  • Re: Cannot reverse the order of printing HP Officejet PRO 8630

    I bought a 8620 and had this problem with Quickbooks.  I called HP and they had me download a driver for a 9800 series printer.  At the time, I was using VISTA as an operating system... YEA I know... so I've upgraded to Windows 10.  The pilot of the 9800 series worked fine with VISTA system. You can change the option Back to front layout... it's what you need in any case to do this.  And it worked with the printer 8620.

    I have now upgraded and have Windows 10 64-bit operating system and still have the printer 8620.  I am looking for a driver that works with your printer 8620 for Windows 10 64 bit Oprating system and has to HAVE THE ABILITY TO CHANGE the option print layout in the "back to the Front.

    That they are used?

    Hello

    Thank you for using the HP forum.

    You can use the Officejet Pro 8600 driver.

    Check out this post.

    http://h30434.www3.HP.com/T5/LaserJet-printing/HP-OfficeJet-Pro-8625-can-t-change-the-print-order-printing/m-p/5002399#M191535

    Hope that helps.

    Good day!

  • history has changed to reverse the order on its own; I'm trying to change back to more recent everything first, but he refuses to deliver

    I check AtoZ, but he won't change, and when I click on "views" once again its modified to return from Z to a... Why it does this in the first place? I don't like what he did.

    See:

    Alternatively, you can check for problems with the file localstore.rdf.

Maybe you are looking for

  • Auto assigned IP &amp; cable disconnected?

    I have a strong signal to internet and my iPad and iPhone are on WiFi fine. However, my older iMac gets these error messages (auto assigned IP and cable disconnected). I can't even know that if I get "bars" he says still no internet on WiFi. What is

  • 11001 socket error, error # ox800cccod when sending e-mail and sending attachments

    Outlook express error 11001   Separate thread: http://answers.microsoft.com/en-us/office/forum/officeversion_other-outlook/socket-error-11001-error-ox800cccod-when-e-mailing/7330d255-3882-40d7-9090-61e772711731  

  • Want 4500: Connection error! The printer could not connect to the server

    Connection error! The printer could not connect to the server! Cannot set up eprint or update the driver. Ever been on the forums and do not understand what to do! I am successfully connected to my router and can print from my pc and my ipad with air

  • Users and Quickbooks accounts

    In QB 10, ' 08, ' 07, I'm trying to run scheduled backups.  QB has advised that it has problems, so I'll try to save on the desktop and will be then copy the backup files to a flash drive.  At the request of the backups worked well until the transiti

  • Line does not come after each row of the list

    Hello I show a list in my current application. In the list, I paint a line after each line. Just a line of string, I add in each line. Now when I'm checking the list, on some devices, lines are coming. As in Bold 9790, after each line, a line is adde