How to upgrade an item in the ListView ListItemComponent

Hello

I have a ListView that uses an ArrayDataModel and a ListItemComponent to display a list of items. One of the elements which is display is a photo that takes place is specified as a URI.  In some cases, this URI is empy and I need to go out and scratch a few location data in real time.  Within the netscrape2:nEffectuer slot, I am trying to take this new found data (URL location to the new location of the photo) and replace it in my ListView. ListItemComponent...

Any help would be greatly appreciated.  Thanks in advance...

Container {
            leftPadding: 10.0
            rightPadding: 10.0
            topPadding: 40.0
            ListView {
                function scrapePicture( ExternalUrl, source, mListItemIndexPath )
                {
                    console.log("Start Search scrapePicture(): " + ExternalUrl );
                    console.log("Start Search scrapePicture() Index: " + Index );
                    netscrape2.scrapeSite(ExternalUrl, source, mListItemIndexPath );
                }
                id: searchListView
                dataModel: searchDataModel
                listItemComponents: [
                    ListItemComponent {
                        id: listComponentSearchResultsListItem
                        type: ""    // I do this because its Array datamodel
                        SearchResultsListItem {
                            title: ListItemData.Title
                            pubDate: ListItemData.TimeStamp + " - " + ListItemData.Location
                            previewImage: ( ListItemData.PreviewImage == "" ) ? ListItem.view.scrapePicture( ListItemData.ExternalUrl, ListItemData.Source, ListItem.indexPath ) : ListItemData.PreviewImage
                        }
                    }
                ]
                onTriggered: {
                    console.log("Invoke Second Page");
                    var feedItem = searchDataModel.data(indexPath);
                    // invoke second page...
                }
                attachedObjects: [
                    ScrapeHttp {
                        id: netscrape2
                        onComplete: {
                            // this is where I want to replace the picture...

                            var data =  listComponentSearchResultsListItem.ListItem.view.dataModel.data(netscrape2.mListItemIndexPath);
                            console.log("netscrape2.data: " + data);
                            data.PreviewImage = netscrape2.adImageURL;
                            console.log("netscrape2.data2: " + data);
                            listComponentSearchResultsListItem.ListItem.view.dataModel.replace(0, data);
                        }
                    }

                ]
            } // end of ListView

Why all this way?

listComponentSearchResultsListItem.ListItem.view.

The above code is only necessary when you want to access the data of ItemComponent, but you try to change DataModel.

You must change the value in your DataModel, in your case, its ID is searchDataModel. No what you have to do is something like this in your onComplete:

var tmpData = searchDataModel.data(indexPath);
tmpData.PreviewImage = netscrape2.adImageURL;
searchDataModel.updateItem(indexPath, tmpData);

Now I don't know what is ScrapeHttp, but it sounds like a weird way of this row.

netscrape2.mListItemIndexPath

Tags: BlackBerry Developers

Similar Questions

  • How to access an item in the ListView

    I have a ListView with a GroupDataModel (a size). I have navigated to specific option when it appears. Unfortunatelly nor

    ListView {
       .
       .
      onCreationCompleted: {
          scrollToItem(QVariantList() << x, ScrollAnimation.None);
      }
       .
       .
    }
    

    Neither

    ListView {
       .
       .
      onCreationCompleted: {
          select(QVariantList() << x, true);
      }
       .
       .
    }
    

    works. (x is a simple number) What can I do else?

    It's the C++ syntax. QML/JavaScript, it would be

    idOfListView.scrollToItem ([x], ScrollAnimation.None)
    or
    idOfListView.scrollToItem ([0, x], ScrollAnimation.None)

  • How to upgrade several items at the same time?

    Hello

    I have about 400 items in my application 2015 DPS that must be updated regularly.

    Sources of Indesign are updated by his colleagues.

    Currently I change the statutes of DPS-2015 individually: I open Indesign, I export the .article file, I open the portal, I am looking for the article, I score, I choose "Replace contents", I chose "update content", I get the previously written file .article and send back them, I click on "Finish", I wait 'ongoing' disappears, I publish content.

    This may be acceptable for different articles. For many items that must be updated frequently, it is very long and tedious.

    There may be faster ways?

    Thank you

    Hans

    There is no faster means to manually download files InDesign based on the article at the moment. I know that the team is working on several improvements in this area, including an approach on the sidecar that would improve your workflow, but I do not have more specific information.

    You can consult this article of any API and scripting approaches: Digital Publishing Solution help | Integration with Adobe Digital Publishing Solution

  • How can I add items to the Menu of the button lock, I don't, change user, close and lock. I want to add 'restart '.

    How can I add items to the Menu of the button lock, I don't, change user, close and lock. I want to add 'restart '.

    How can I add items to the Menu of the button lock, I don't, change user, close and lock. I want to add 'restart '.

    This tutorial should do what you want. Use method 2.
    http://www.Vistax64.com/tutorials/105003-shutdown-options-start-menu.html

    Please read all notes caefully, not only the parts of the statement.

    t-4-2

  • How can I add an item to the ListView

    I have a very basic question. I would like to read data from a file xml in the ListView, then add an item to the list and store it in the file xml again. How can I do?

    {To ListView

    ID: listViewCustomUrl

    objectName: "listViewCustom."

    dataModel: {XmlDataModel}

    Source: "dataCustom.xml".

    }

    }

    First of all, your xml file must be in a read/write file in your directory app, say data, for example.

    Then, you can use a DataModel in memory (GroupDatModel), fill it with XMLcontents, a number of updates for this model, and then when your output or with an option to be persisted in the xml file.

    See the example of persistent objects in http://blackberry.github.io/Cascades-Samples/persistentobjects.html

  • How to remove all items in the download under bookmark folder in the shortest time?

    I understand that all downloads from the internet and yahoo/google mail are stored in the "Download" folder I bookmarked when I want to delete. I think that if the download folder is never empty, then my mac will slow down. So I want to remove these downloads that I've seen. How can I remove all THE items in the shortest time? Deleting items, even in groups, takes a long time. Is there a method I can use so that all the items in the folder are deleted in one fell swoop?
    Thank you.
    Unguja

    Yes, it worked. Thank you very much.
    Unguja

  • How to remove an item from the Favorites folder in the library?

    I'm new to the movement and try to learn to use it.

    In the library is the favorite named folder. I spilled some items in there (moved from content folders, transmitters of particles or generating things) that I would like to delete now.

    I guess these things in the favorite folder are just aliases to the actual items, but I can't figure how to get rid of them.

    Highlight an item in the Favorites folder and pressing the delete key do nothing. Command + del also does nothing. Control-click about to bring up any option decision Trash. Drag the item out of the folder and the desktop does nothing.

    I also created a custom folder in the Favorites folder I want more, and I can't get rid of anyone.

    Can someone tell me how you delete something in the Favorites folder you want is more in there?

    Tom B.

    The content of favorites are in user/Library/Application Support / movement / favorites...

    erase all the content - done.

    No, not very Apple like

    fox_m advice is correct!

  • How to upgrade my firmware to the printer?

    Hello

    I'll do a tutorial on how to upgrade your firmware.

    This ensures that the printer is wise software up-to-date, and it gives you the features more to update that is available for the device you own.

    This video will show you step by step on how to update the firmware on your printer.

    More firmware updates will give you a list of what it will be Fix/improvement:

    For example:

    Fix/development:

    (1) improve the Diagnostic ePrint for ePrint Setup report
    (2) improve the ease of wireless configuration
    (3) integrated Web of enhanced Services
    (4) improving the print quality
    (5) improve ink consumption
    (6) improve the performance of path of paper
    (7) to improve the performance of numerical analysis

    If you have any questions let me know.

    I hope this helps!

  • How can I add items to the desktop right click

    How can I add or remove items from right click menu

    Hello

    These should help control the right click Menu:

    The ShellExView utility displays the details of shell extensions installed on your computer and allows you to turn on and off easily each shell extension.
    http://www.NirSoft.NET/utils/shexview.html

    Manage the entries in the context menu for files, folders, disks, and objects in the Namespace
    http://WindowsXP.MVPs.org/context_folders.htm

    ShellMenuView is a small utility that displays the list of menu items which appeared in the context menu when you right click on a file/folder on Windows Explorer and allows you to easily disable unwanted menu items.
    http://www.NirSoft.NET/utils/shell_menu_view.html

    How to change or remove items from the right click Menu.
    http://www.WinVistaClub.com/E11.html

    I hope this helps.

  • Clear the selection of items in the ListView

    I have a ListView with different elements.

    For the most part I have multiple selection items as the default, but for some items I would like to completely disable the selection.

    I tried to disable the cell while it displays a unselectable element, but this only disables the selection of direct events on the cell. I can still select it by clicking on an element above one, and then shift-click on an item below.
    I also tried to set the empty cell at the display of an element not selectable. This is the problem with the above shift selection, but I can always choose the cell by selecting an element next to him and pressing the respective arrow key.

    Does anyone have an idea?

    Thank you
    L2P

    I have not tried to do, but the first thing I want to try (or at least consider) would be to write a custom selection model.

  • How can I reinstall items on the new computer - old one crashed

    I bought elements in November, and recently my computer crashed.  I need to reinstall the components, but I only bought the downloadable version.  I can't have the software on my old computer.  How can I reinstall items on my new computer.  WAF

    Jeff,

    Thanks for responding.  I bought items through Amazon, and I could

    go the my library of software and download it.  Think that I'm right

    track.  WAF

    =========================

  • How to remove unused items from the library?

    Dear all,


    Flash CS4 is really good for the design and development of point of view. But I noticed two things:

    1. If the library has more point so there is no option on right click "select unused items". How can I get this option "select unused items" on click right while the library has one more items with the scroll bar?
    2. Height of the window actions sometimes increased. Right now there is no option to decrease the height of the window actions except the Reset option.

    Please let me know if I'm wrong!

    See you soon

    Uday Singh

    SR. ActionScripter

    [email protected]

    Why can't you use the library Panel Options option?

    -kumslee

  • How to manually remove items in the Add/REMOVE list

    I uninstalled a particular program, but it still appears in the Add/REMOVE list. It is still also in the folder programs. How can I manually remove this program in the Add/REMOVE list?

    Hi Sweetpence51,

    1. are you able to uninstall properly the other programs on the computer?

    2. you use Windows vista or Windows XP operating system?

    Method 1

    First of all, make sure that you have followed the right instructions to remove the program from the computer.

    If the program does not uninstall completely the first time, sometimes running the uninstall program a second time will succeed.

    Troubleshoot installing or uninstalling programs

    http://Windows.Microsoft.com/en-us/Windows-Vista/Troubleshoot-installing-or-uninstalling-programs

     

    Method 2

    If you are unable to remove the program from the Add/Remove programs then you need to remove the keys associated with the program from the registry.

    Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, see the link below.

    Back up the registry

    http://Windows.Microsoft.com/en-us/Windows-Vista/back-up-the-registry

    Note: In the procedure below, replace Add/Remove programs and features if you are using the Windows vista operating system.

    (a) click Start and in the search box, type regedt32, and then click OK.

    (b) in the registry editor, find the following registry key:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall

    (c) in the left pane, click the Uninstall registry key, and then click export on the file menu.

    (d) in the export registry file dialog box that appears, click desktop in the list record in , type Uninstall in the file name box, and then click Save.

    (e) each key listed under Uninstall in the left pane of Registry Editor represents a program that is displayed in the list of currently installed programs in the add tool / remove programs. To determine which program that represents each key, click the key and discovers the following values in the details on the right pane:

    DisplayName: Data of the value of the DisplayName key is the name listed in Add / Remove programs.
    - and -
    UninstallString: The value of the UninstallString key data the program used to uninstall the program.

    (f) after you identify the registry key that represents the program that you removed but which is still displayed in the list of currently installed programs , add or remove programs, right-click the key in the left pane of the registry editor window, and then clickRemove.

    (g) click Yes in response to the message "are you sure you want to delete this key and all of its subkeys?

    (h) on the file menu, click Exit to quit the registry editor.

    (i) click Start, click Control Panel, and then click on Add / Remove Programs.
    In the currently installed programs list, verify that the program whose registry key you deleted is no longer listed.

    (j) do one of the following:

    1. If the program list is not correct in Add / Remove Programs, double-click the file Uninstall.reg that you saved on your desktop in step 5 to restore the original list of programs in the registry.
    -or-

    2. If the program list is correct in Add / Remove Programs, right-click the Uninstall.reg file on your desktop and then click Remove.

    How to manually remove programs from the add tool / remove programs

    http://support.Microsoft.com/kb/314481

    Note: The preceding Microsoft article also applies to Windows vista operating systems.

    I hope this helps!

    Halima S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to upgrade PVE political in the Oracle 11 g 2 database

    Hello

    I am trying to connect to a SFTP with JAVA server in the Oracle database (using Java lib jcraft jsch (lib)

    I added JAR files in database, compile my proc stored without errors.

    When you try to perform my procedure, I have this message

    "" Aes256-cbc"cipher is required, but it is not available.

    On my desk, I can update my JDK with UnlimitedJCEPolicyJDK7 PVE security

    But how do I update PVE of the JDK to the database? h

    I've updated the files $ORACLE_HOME/jdk/jre/lib/security/local_policy.jar and $ORACLE_HOME/jdk/jre/lib/security/US_export_policy.jar but it does not work.

    Any ideas?

    Thank you

    The PVE for JDK6 is evil, because the version of the JDK in Oracle Database 11 g 2 is JDK5 (!)

    So I updated with this JCE jar files: Java Archive downloads - Java platform Technologies

    And it works!

  • ADF MOBILE: how to add an item in the list without refresh the entire list

    Hello

    I am using this method to add an item to a list (I've already added the item to the data model):


    providerChangeSupport.fireProviderCreate (String providerKey, int newRowKey, object newValue);


    I don't want refresh the entire list, rather, I want to just add a new item to the list, that's why I want to use this method.


    I want to know, what value should I use for the second argument? i.e. 'int newRowKey '.


    Thank you


    Hello

    the event of change of provider in your case seems to actually create a new line. So the int is the rowKey (index PK or line) of the new line. There is no other choice to simply add an element to a list (ADF Mobile provides no component handles)

    See: Embedded Java/ADF for beginners: ADF Mobile: refresh your valuable data

    Frank

Maybe you are looking for