ArrayDataModel and asynchronous data

Hello

I've done listview with a custom ListItemComponent and I need to show 20 items and when the descent to the bottom of the screen 20 is another element, like at the end of the data.

And I using the data source.

I saw these pages, and I knew a little information.

https://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__arraydatamodel.html

https://developer.BlackBerry.com/native/documentation/Cascades/UI/lists/asynch_data.html

A few attempts worked, but did not work with me.

Now, I know when you go down down, by which I can add data:

ListScrollStateHandler {
            id: scrollStateHandler

             onScrollingChanged: {             if (atEnd) {                  // I can add more data                           }
                                           }
                               }

My question:

How to do when running the application view 20 items only, then when using 'atEnd' indicate the other elements, at the end of the data.

Thank you!

import bb.cascades 1.2

Page {
    Container {
        ListView {
            id: listView

            dataModel: GroupDataModel {
                id: listDataModel

                sortedAscending: true
                sortingKeys: ["label"]
                grouping: ItemGrouping.None
            }

            onCreationCompleted: {
                for (var i = 0; i < 100; i++) {
                    storageDataModel.insert({"label": "test " + i})
                }
                move();
            }

            attachedObjects:
            [
                ListScrollStateHandler {
                    id: scrollStateHandler

                    onScrollingChanged: {
                        if (atEnd) {
                            listView.move();
                        }
                    }
                },
                GroupDataModel {
                    id: storageDataModel

                    sortedAscending: true
                    sortingKeys: ["label"]
                    grouping: ItemGrouping.None
                }
            ]

            function move () {

                if (listDataModel.size () >= storageDataModel.size())
                    return;

                var objectList = []
                var n = listDataModel.size()

                for (var i = n; i < Math.min(storageDataModel.size(), n + 20); i ++) {
                    var myIndexPath = []
                    myIndexPath[0] = i
                    var item = storageDataModel.data(myIndexPath);
                    objectList.push(item)
                }
                listDataModel.insertList(objectList);
            }
        }
    }
}

Tags: BlackBerry Developers

Similar Questions

  • Save and write data from table to table - easy

    Hello

    I got this system delivered to me. I'm new to LabView and just save the data from the table "average voltage" (inside the while loop) to do some additional testing of our product.

    I will like to do similar to this.

    (1) save in excel file.

    (2) save only when a button button and save it then 5 ilteration.

    (3) save and manipulate the data, so it is displayed in 6 columns (each LED 1) instead of 1 long colum.

    I tried different things with structure business T/F, which resolved the buttom-request. But I am in doubt I should use, writing to the file of the measurement or write to us to the worksheet (by using labview 15.0)-delimited according to my offer the best possible?

    He also seems to be too much to handle when I try to write in txt file, because it pops up with and error that I do not know how to fix, but it says this:

    Error-200279

    Possible reasons:

    The application is not able to cope with the acquisition of equipment.

    Increase in the size of buffer, most frequently the reading of data or by specifying a fixed number of samples to read instead of reading all available samples would correct the problem.

    Property: RelativeTo

    Corresponding value: current playback Position

    Property: Offset

    Corresponding value: 0

    Task name: analog channel

    Thanks in advance

    I agree with Taki, but want to make some additional remarks:

    • LabVIEW is a data flow language.  Think of the "flow" of your data.  You talk about "save only when a key is pressed" and a finite set of data.  You are collecting before the press the button and everything just do not save?
    • Data are collected at some rate, and likely, you don't want to "Miss" data points.  This means that you shouldn't do anything in the loop of the Collection that takes a long time.  If your recovery rate is low and your treatment is fast, you can have everything in a single loop.  Otherwise, to use the technical stream (producer/consumer is a good) to process the data in a single loop in parallel with the collection in a loop independent (and asynchronously).
    • How do you write your data?  You want to write "on the fly", as it is, or can you wait, collect everything, any format and then write it "all at once"?
    • What do you mean by 'save the file in Excel?  Do you mean a 'native' Excel file, one with the extension .xls or .xlsx?  Do you mean a Comma-Separated Variable (.csv) file this reading peut of Excel (and, indeed, usually registers itself to read, change the icon of the .csv files to "look like" it is really an Excel file)?  If the first case, I recommend using the report generation tool.  But for the latter, you can also use write delimited spreadsheet, which can be easier to use.

    Bob Schor

  • CDC Logminer synchronous and asynchronous

    I have to configure CDC Logminer.
    My source is oracle.
    I want to know what is the difference between CDC Logminer synchronous and asynchronous.
    And in the oder to configure do them I need to do anything beside the database other than in ODI. If yes what should I do?
    And also want to know what I have to do in ODI also

    I'm really grateful if anyone can help me with this.
    Thanks in advance

    Published by: user10390682 on 27 Sep, 2010 12:19

    Synchronous LogMiner is like putting triggers on tables system, be careful. If you are using asynchronous, logminer will find the changes, but there may be a time lag before you - when the db allows to do its stuff logminer, could be up to two minutes later that I saw, if the database is busy.
    You don't need to do something else in the database, and in ODI you use just the "Journalisé Data Only" box on the interface to pull changed lines.

  • When I send a text message and mobile data are off, it is not given, but I do not see this message for a few minutes. I can then refer using "send as a text message. How can I 'send as a text message' in the first place?

    When I send a text message and mobile data are off, it is not given, but I do not see this message for a few minutes. I can then refer using "send as a text message. How can I 'send as a text message' in the first place?

    Disable the iMessage?

  • How can I recover the modules and their data from a failed HARD drive (the lost BONE areas, but data files are readable)?

    The HARD drive that was my OS (Windows XP Pro SP3) failed and lost quite a few areas which are essential for the operating system running. Other data is still readable. A got another HARD drive and installed Windows XP SP2, Firefox and other programs. I was able to retrieve the bookmarks, security certificates, and other profile information using the information found in bandages.

    None of them addressed how do to recover the modules or their data. Specifically, there are several large, elegant scripts that took months to develop and customize.

    Articles related to migration and other do not work for me because they require the old copy of FF is functional, that is not because the OS on this HARD drive is damaged. Is it possible to recover these data, similar (or not) about how I could get the other profile info?

    Have you copied the entire folder C:\Documents and Settings\username \Application Data\Mozilla\Firefox\ on the old drive?
    If this is not the case, can you?
    If so, make a copy and save this folder just in case.

    If so, you could replace this folder on the new facility by \Profiles\ [with your profiles inside] folder and the profiles.ini file [delete all other files / folders that may also be in the folder "Firefox"] -and then replace with the same folder named from the old failed drive. Note that you will lose what you already have with the new installation / profile!
    Your profile folder contains all your personal data and customizations, including looking for plugins, themes, extensions and their data / customizations - but no plugins.
    But if the user logon name is different on the new facility that the former, any extension that uses an absolute path to the file in its prefs will be problems. Easily rectified, by changing the path to the file in the file prefs, js - keep the brake line formatting intact. The extensions created after the era of Firefox 2.0 or 3.0, due to changes in the 'rules' for creating extensions usually are not a problem, but some real old extensions that need only "minor" since that time can still use absolute paths - even though I have not seen myself since Firefox Firefox 3.6 or 4.0.

    View instead of 'Modules' I mentioned the 4 types of 'Modules' separately - Plugins are seen as 'Add-ons', but they are not installed in the profile [except those mislabelled as a "plugin", when they are installed via an XPI file], but rather in the operating system where Firefox 'find' through the registry.

    Note: Migration articles can tell you do not re - use the prefs.js file, due to an issue that I feel is easily fixed with a little inspection and editing. I think you can manage that my perception is that you have a small shovel in your tool box, if you encounter a problem you are able to do a little digging and fixing problems with the paths to files - once you have been warned.

    Overall, if you go Firefox 35 35 or even Firefox 34 to 35, I don't think you will run in all the problems that you can not handle [that I cross my fingers and "hope" that I'm not on what it is obvious].

    With regard to the recovery of the 'data' for individual extensions - there are many ways that extension developers used to store their data and pref. The original way should save in prefs.js or their own file RDF in the profile folder. While Firefox has been developed more, developers started using their own files in the profile folder. And because Mozilla has started using sqlite database files in Firefox 3.0, Mozilla extended their own use of sqlite, as have extension developers.
    Elegant uses the file stylish.sqlite to store 'styles', but something in the back of my mine tells me that 'the index' maybe not in this file with the data. But then again, I can be confusing myself a question I had with GreaseMonkey awhile back where I copied the gm_scripts folder in a new profile and with already installed GreaseMonkey but with no script. These GM scripts worked, but I could not see them or modify them - they do not appear in the user GM extension interface window in Firefox.

  • Error of Facebook, what can I do? Resource://jid0-wpch2liwmumjc8av1vwejwvgjbi-at-Jetpack/qclean-remove-Facebook-ads-suggested-pages-and-posts/data/qclean.js:53

    Facebook maintains the gel, a problem caused by this script resource://jid0-wpch2liwmumjc8av1vwejwvgjbi-at-jetpack/qclean-remove-facebook-ads-suggested-pages-and-posts/data/qclean.js:53

    I tried many solutions suggested, nothing works. Please advse. Thank you.

    Ed

    Hello ed, this error is caused by the qclean addon that you have installed. Please disable or delete or report the problem to the author of the extension...

    Disable or remove modules

  • I am not able to download apps for my iPhone on the App Store. He just 'waiting '. But never starts the download. I tried with wifi and mobile data. The two are not download apps

    I am not able to download apps for my iPhone on the App Store. He just 'waiting '. But never starts the download. I tried with wifi and mobile data. The two are not downloading the applications Can u find out what's wrong? I use iPhone 5s

    I had the same problem. At the same time hold the screen lock button and the home button until your iPhone restarts. That solved the problem for me.

  • How to eject my iphone, or player card on my macbook air?  I don't want to disconnect and lose data...

    How to eject my iphone, or player card on my macbook air?  I don't want to disconnect and lose data...

    You won't lose data when you remove an iPhone, unless you're in the middle of the backup or synchronization of the device.

    If you see no activity in iTunes/Photos/etc... Then, it is safe to unplug.

    With a card reader (SD card?) you do drag the desktop icon to the trash. It turns into an arrow when you drag an icon ejector.

    Similarly, you can click Finder on the dock, then locate the reader on the left column and click on the "arrow" to the right of the device to eject it.

  • Since the last system upgraded my menu bar top with wifi and time, date etc etc is hidden unless I have sulk my cursor on it. Same thing with apps from shingles. How can I restore it is always there?

    Since the last system upgraded my menu bar top with wifi and time, date etc etc is hidden unless I have sulk my cursor on it. Same thing with apps from shingles. How can I restore it is always there? bar menus hidden-how do I restore?

    SystemPreferences-> Dock: automatically hide / show Dock

    SystemPreferences-> general: automatically hide / show menu bar

  • Prob w/Importing Favorites and other data from Internet Explorer

    Everything by following the steps described in the forum article titled "Importing Favorites and other data from Internet Explorer" after completing step 3, select which points to import, if I select all the option or just the Favorites, I get the same error "Firefox has stopped working... close the program."

    I am importing of IE 8 on laptop Win7 OS. I tried importing every time and cannot get past this error. I made an export of IE8 that takes the form of a html file that there is apparently no option in Firefox to use.

    in Firefox:
    Bookmarks > organize bookmarks-> import and backup - import HTML... = HTML file

  • Is it normal that my iPhone 6 sec to drain the battery overnight so that wifi and cellular data are turned off?

    My 6s iPhone drains the battery overnight

    WiFi and cellular data off

    Not normal.

  • Why the hard disk is divided into partitions of two data (C:Vista and E: Data)?

    I just started a new A200-1V0 and found that disk space is divided into two partitions of sizes equal 'C:Vista' and ' E: Data "(and a small one EISA).

    WHY? What is the logic and purpose? It's not even as if the C:Vista partition is smaller and intended only to the tricks of the 'system' as the root 'Users' (user Documents) is on it also.

    This is the default for Vista (my first use of it), if not, who said that Toshiba could do this without asking me?

    How can I move the root 'Users' in Vista (in the data partition) - if I have two partitions that I might as well use it?

    I can resize partitions in Vista without a utility 3 rd-party (or a complete backup/restore)?

    Thank you

    Hello just YOU

    Please don't be offended because there is no reason for this. You bought the new product with the factory settings. Toshiba and other hardware manufacturer do not know every customer personally and, unfortunately, it was not possible to ask YOU how to set up YOUR laptop.

    Because of this, there is a recovery of product support that allows to configure the HARD disk according to your wishes and needs.

    Please use this DVD and install OS how you want it to be. What recovery procedure starts, you will see CONFIGURATION option on the right side. Click on it and choose the right option.

    Reinstall the OS and enjoy your life. Really, I don't have the time to write on the floors of two partitions, because this is basic stuff and you probably don't want to waste your time to read this.

    Bye and good luck!

  • Re: Satellite L300 - 11G - Configuration and other data is not displayed

    Hello. I have XP on my computer and I have problem with wireless card.
    All drivers are kept for the card but in the configuration utility of the wireless MAC address client and other data are not displayed.

    Can someone help me?

    Hello!

    To be honest I don t understand what you want.
    Maybe you should explain this better.

    The configuration as the IP address and MAC address, you can see in the command line. Start-run-cmd-ipconfig/all online online online

    Good bye

  • Is it possible to add the location and the date on the pictures in a slide show?

    Is it possible to add the place and the date on the pictures in a slide show?

    Only if you manually add a title slide t photo and enter this information manually.  There is no automatic way in Photos.

    Click on the button "+" at the right end of the slide show to add a title slide.

  • When I view my Photos, they have a place and a date. How can I print them with that on them?

    When I view my Photos, they have a place and a date. How can I print them with that on them?

    You want to print the information on the image itself?  To do this, you will need to export the picture on the desk and edit it with a 3rd party image editor that supports the text and layers:

    Some Image editors that support layers and text:


    Photoshop Elements for Mac 11 - $79

    GraphicConverter - $40
    The Rainbow painter - $30

    Photos of affinity- $50

    FX Photo Studio - $30

    Inpaint - $20
    Imaging - $38
    Acorn - $50

    Pixelmator - $60

    Seashore - free

    GIMP for Mac - free (Yosemite & Mavericks only)

Maybe you are looking for

  • How to completely erase my hard drive?

    I'll get an upgrade on my iMac 27 "late 2009. I don't want to turn with all my data on it. I took a return to the top.

  • Guard Satellite Pro stopping suddenly.

    My laptop is suddenly stop - and do not restart."It happens esp if I try to do a scan Mcafee - when it comes down to a ' 1386 file" on the C: drive it stops! (but it also stopped at another time).I've defragmented it and cleaned up the cookies etc. I

  • 9.2 mail attachments

    iMac (retina 4K, 21.5 inches, end of 2015), 3.3 GHz Intel Core i7, race 16 GB 1867 MHz DDR3 El Capitan 10.11.2 and 9.2 of Mail. My question is in mail is it possible to print the attachments without first save the attachment. I looked online for a so

  • Qosmio G20: Qosmio player and FM Tuner

    I saw a question on the FM tuner in the Qosmio G20 series (and other portable with Qosmio Player). Users responded that the Qosmio Player has no FM tuner! That's wrong! I did a manual search in Qosmio Player using frequency analysis, and it is possib

  • Satellite L655D-12-keyboard and mouse problems

    My apologies if this has developed before, but I found nothing during a search. I bought the L655 computer laptop (PSK1NE) in October with Windows 7 HP and all recently I noticed a problem more and more frequent with the mouse and keyboard that goes