Sharing data in a list

Hi all!

I apologize for this brings one more time, but I still can't understand how to SHARE data in a list item by clicking a button (not an element of action invoke). I think I'm close, but at the moment it does not work

I found some help on code 'share whatever it is' topics, but I can't get it work in the main.qml, the List.qml

any ideas?

Thank you

-Ali

hand. QML

import bb.cascades 1.0
import "common"

Page {
    Container {
        Container { // START WORKING CONTAINER

            Label {
                id:goodFruit
                text: "Orange"

            }
            Label {
                id:goodweight
                text: "12oz"
            }
            Button {
                text: "This works!"
                onClicked: {
                    _app.share("I eat " + goodFruit.text + " that weigh " + goodweight.text);
                }
            }
        } // END WORKING CONTAINER
        Container { // START NON-WORKING ListView

            ListView {
                id: fruitList
                dataModel: XmlDataModel {
                    source: "models/fruitModel.xml"
                }
                listItemComponents: [
                    ListItemComponent {
                        type: "header"
                        Header {

                        }
                    },
                    ListItemComponent {

                        type: "entry"
                        FruitListItem {

                        }
                    }
                ]
            }
        } // END NON-WORKING ListView
    }
}

FruitListItem:

import bb.system 1.0
import bb.cascades 1.0

Container {
    Label {
        id: badfruit
        text: ListItemData.FRUIT
    }
    Label {
        id: badcolor
        text: ListItemData.COLOR
    }
    Label {
        id: badweight
        text: ListItemData.WEIGHT

    }
    Button {
        text: "Does NOT Work"
        horizontalAlignment: HorizontalAlignment.Center
        onClicked: {
            _app.share("I can NOT share" + ListItemData.Fruit +    ListItemData.COLOR + ListItemData.WEIGHT + "...Do you know why?");
        }
    }

}

I get the following error:

Asset:///common/FruitListItem.QML:26: ReferenceError: can't find variable: _app

Hello

It's all about context ListItem.

Give an id to fruitListItem, for example:

                        FruitListItem {
                             id: fruitListItem
                        }

Declare a function in the ListView:

ListView {
  function getApp() {
    return _app
  }

Instead of _app.xxx () call fruitListItem.ListItem.view.getApp (.xxx ())

Tags: BlackBerry Developers

Similar Questions

  • Updated Kaspersky and have been asked to deny/allow the following "Setup of Kaspersky Safari Extension wants to use your confidential data stored in 'List of extensions Safari' in your keychain"-is it safe?

    Update of Kaspersky, it asks me to deny/allow what follows - "Installer Kaspersky Safari Extension wants to use your confidential data stored in 'List of extensions Safari' in your keychain"-is it safe?

    # Kaspersky is one of the worst AV packages that you can install on your Mac. I suggest that uninstall you it. All he will do on your Mac is causing problems and offer no addition protection what so ever.

    Once you think you have managed to get rid of it, please download and install EtreCheck from http://etrecheck.com/

    Run it and post the report here. From the snapshot of your Mac, we say if you missed any bit and pieces during the uninstallation of Kaspersky.

  • The data in the list scrolling

    Hello world

    I use the normal list in my app, bt the problem is that the width of the list item.

    I have no problem with the list in landscape bt from potrait extra mode "".. "". are coming instead of data,

    Is it possible to scroll through the data in the list, (average is the width exceed then automatically the data in the list will scroll,)

    someone can help me. urgnt iam waitng...

    Thanks in advance

    I found the solution which equavalent to scroll.

    I'm overiding method of label in the cell renderer class and applying the marquee event it is great it possible to scroll.

  • Maps JSON data with two data in the list

    Hey all,.

    Been working with JSON data and informing the lists for a some time now, but im stuck now on a single set of data.

    The data structure is the following:

    [
         {
              data: {
                   children: [ {
                        {}
                        {}
                        {}
                   } ]
               }
         }
    
         {
              data: {
                   children: [ {
                        {}
                        {}
                        {}
                   } ]
               }
         }
    ]
    

    The data that I take care of normally contains one of these structures and not 2 as in the above data. So what follows could could work:

                                    const QByteArray response(reply->readAll());
            ArrayDataModel *model = new ArrayDataModel();
    
            bb::data::JsonDataAccess jda;
            QVariantMap results = jda.loadFromBuffer(response).toMap();
            QVariantList children = results["data"].toMap()["children"].toList();
    
            model->append(children);
            mListView->setDataModel(model);
    

    However, it is now giving me an empty list. So how can I limit the above code to analyze and insert only the 2nd set of JSON data in the list?

    Please let me know if it needs to be clarified. Any help is appreciated. Thank you!

    Hello

    It contains a list of maps. Have you tried something like the following:

    bb::data::JsonDataAccess jda;
    QVariantList results = jda.loadFromBuffer(response).toList();if (results.size() >= 2){
        QVariantMap secondSet = results.at(1).toMap(); // to get the second map
        QVariantList children = secondSet["data"].toMap()["children"].toList();
        model->append(children);}
    
  • LiveCycle ES2 data drop-down list issue

    I'm trying to make a dynamic form based on a table in SQL 2008R2 database. I need to have a list that fills the data drop-down list database and then when this list item is selected, fill the rest of the document from the fields of the database based on the selection in the drop-down list. I understand the drop must be linked to the data connection, but I can't get the list items to act as if the documentation says they should. Here's what I've done so far:

    1. under tools/options that I have appointed the data binding should display dynamic content.

    2. I have created a data connection to the database and can see all the fields of data in the data view tab, and can also put these fields in the document.

    3 when I place the list on the drop-down list data form, I indicates the list to be bound to the data connection that I created previously, and the tab link has this: ' $record. DataConnection. databasefield'.»

    4. from what I understand, the field tab, list items should be a green hypertext link, and it isn't. I have no idea why, or how do I have to do from here.

    I also asked a lot of the software, or am I missing something to make it happen. I have struggled with this for a few days now and I am ready to move on for reporting. If anyone can help?

    Thanks for any advice or help

    Hi again,

    I opened your form and looked at the XML properties in the LiveCycle. I noticed that your form is only a form interactive but not considered a dynamic form.

    In order to use the dynamic properties option, you need to create a dynamic form.

    Unfortunately, your form is in fact an image and have no objects with the exception of the fields, so I did a quick for you.

    I suggest you create a new form and redo the form.

    Make sure you have dynamic properties when creating the new form, I don't know if master pages is the trick to get a PDF be interactive with the dynamic properties

    If you have trouble doing this, let me know

    I hope this will help you

  • Sharing data between the host computer stores in different groups.

    I read in several places that sharing of data warehouses between the host in different groups is possible, but I don't get the warm and fuzzies when the hosts are different versions.

    vCenter is 4.1

    Group Alpha is 4.0 vmfs 3.33

    Bravo of cluster is 4.1 vmfs 3.46

    My goal is to move the virtual machines that meet the specific criteria of group Alpha for Cluster Bravo then the availability of flowing freely between clusters.

    The only concern I have is when adding Cluster Bravo to the same host of 3PAR alpha value of Cluster sharing all the data store, Cluster Bravo will try to reformat to vmfs 3.46 break Cluster Alpha to see the virtual machines stored in the warehouses of shared data?  I don't want to present the old warehouses of data to the new cluster only break from old cluster.

    Hello vmsjsn

    ESX/ESXi 4.X supports all versions of VMFS file system.

    Using your example of Alpha and Bravo. Kudos to will write more Alpha. you will be able to cross all hosts on the shared storage.

  • PDF attesting to the safety of the shared data or folio

    Hello

    We have a client with which we will begin a contract of application sharing.

    He wants to have a document or .pdf attesting to the safety of the shared data or folio.

    do you have a response to this topic please

    Thanks in advance

    http://wwwimages.Adobe.com/content/dam/Adobe/en/security/PDFs/adobe_dps_security_wp_web.PD f

    Neil

  • Lost ESX Server shared data store

    Hello

    I can't find the data store shared in one of my ESX Server. And I try to rescan and may find the logic unit number but just can't find the shared data store. This is the channel san fibre storage system.

    Is it possible to return the lost shared data store?

    Thanks in advance!

    LAN

    You mean it must be confirmed if the partition table is OK first? But how to confirm...

    Just run this command:

    fdisk-l

    You should see your LUN with a VMFS (type fb) partition.

    André

  • Store shared data will not be displayed in the laboratory Manager

    I have a shared data store that is fully recognized by both my ESXi hosts in pointing that client vSphere vCenter Server. I can browse the data store, download files, delete files, but not even opinion in Lab Manager. I tried to remove and re-add the data several times store. using a different initial host each time. The data store is picked up again by the two hosts and its status shows as usual in the vSphere Client. No matter what I do well, I can't make it appear in the laboratory Manager. Does anyone know where I could go wrong?

    Thanks for your help,

    will be

    You don't want to say that in the resources tab Datstores, you do not see this at all shared data store? You are in global org global org or not? What version of LM do you use?

    If you are in an organization overall, newly added data store should appear immediately. But if non-global organization, go to the Organization-> properties-> data warehouses and add this new data store.

    MoHA-

  • Sharing data between views

    Hello

    I have a simple display object that I use to connect, he questions just the user name and password in the users table.

    I have an another display object that uses a query much more complex that retrieves detailed information about this user in different tables.

    I have a simple taskflow, a view of the opening of session and a current view, if you log in successfully, you go to the main page.



    Now if I use the first view (simple) object to display the username etc then it correctly displays the name of the user who is logged.

    If use the other more complicated view opposing it just show the first returned row.

    In short, my question is this, if I connect with the object from a point of view, how can I tell the view which line to select another object? I.e. the details of the logged-on user?

    I tried to create a link between the objects in view, but which only sort of worked. After that I logged it didn't show the correct line, but after I went to another page that uses the original view object, then he did display the line concerned.

    I bet that it would make no sense, but I don't know how else to explain it.

    I connect with the view object X.
    View object there may not know what line in X, I'm interested.
    If I connect X to Y then I have to go to another page in the application X is used in front go understand what line X is on.

    Help, please!

    Looks like your 'Complex' view must have a binding parameter to filter the query of a specific user and your speed of connection must pass this id on the container page.
    Discover models of sharing data between regions here:
    http://www.Oracle.com/technetwork/TestContent/adfregioninteraction-155145.html

  • Clarification? : book Frank & Lynn - "shared" data control scope workflow

    I'm looking for clarification around extended shared data of control please, about a point made in the book "Oracle Fusion Developer Guide" McGraw - Hill Frank Nimphius and Lynn Munsinger.

    On the 229 page there is a note saying "the extent of control of data can be shared if the transaction is also shared. Without doubt, this means that only transaction options 'Always use of existing Transaction' or ' use existing Transaction if Possible "are applicable to a range of shared data control.

    However this seems at odds with what the supports of the IDE, you can also select the transaction options '< no Transaction Controller >' and 'Always start new Transaction' when the data control range is set to shared.

    Which is correct? The IDE or the book?

    Your help is appreciated.

    CM.

    Chris,

    "The scope of control of data can be shared if the transaction is also shared.

    At least the book is OK for what I tested in a simple test case:

    1. no transaction - no sharing

    -no synchronization of master-detail. DC are bot shared
    -validation in called btf commits not calling workflow

    2. "always use existing" transaction selects the shared data control and disables this field automatically, so there is no other choice for this

    3 share DataControl and always "begin transaction".

    Validation of transaction in btf called also commits the transaction by calling TF

    Bottom line is therefore the operation of the ADFc handling seems to be confusing because it is only a guideline for the DataControl to interpret.

    See also page 14 "task flows 'new deal' vs"new db connection"" from: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/march2011-otn-harvest-351896.pdf

    In British Colombia ADF, it seems that separate transactions exist if you use the isolated mode. If you use shared transaction and new then essentially transactions are not isolated.

    Frank

    PS. : I took an action item followed with development about what the expected behavior of the ADF BC for the parameters of the controller are.

  • What are sharing data?

    I can't find a definition of the term "data sharing" what is it? I can turn on and out, but what data is shared and with whom?
    Thank you

    hornetmo said

    I would like to know exactly what is to be 'shared' and taken from my copy of FireFox.

    Hi hornetmo, it's kind of an important issue because Mozilla (the maker of Firefox), individual authors of Add-ons and the pages that you view all will have different data access.

    As you may have read in the above-linked article on the health report, Firefox keeps data on its performance. Please see the 'Choice of data' tab of the dialog box Options for more details on the different types of data your Firefox may refer to Mozilla, what it's for, and how to control:

    Advanced panel - accessibility, navigation, network, updates, and other advanced settings in Firefox

    Add - ons may monitor your use of them, and/or your other use of Firefox. Always check the reviews of new Add-ons to see if there are complaints of privacy made by other users and try to know as much as you can, what kind of follow-up/monitoring they do.

    Websites, particularly popular sites supported by advertising, can capture a lot of information about your activity. Is this something you want to learn more, or simply the browser and Add-ons?

  • Shared data varying variable published network write error

    In my project in real time, on the VI host running on my Windows PC, I try to write in a number of published network shared variables.  All these write operations are successful (which means that I can read them on the RT target, then a cRIO-9012), except for these shared variables network-published with data type defined as Variant.  I'm not sure what is causing the problem.

    I take the table of clusters shown here...

    .. .and going through one "in Variant' VI and then subsequently in writing to the shared variable (data type: Variant).  Diagnosis of the failure of the VI in real-time to read the data, I found that variable writing shared on the host VI produced the following error:

    Error - 2147467259 appeared to Variable shared in the PC host TTS CTRL.vi

    Possible reasons:

    LabVIEW: Unspecified error (Hex 0x80004005).
    =========================
    System OR Configuration: Various operating default (Hex 0x80004005).

    This error or warning occurred when writing the following shared Variable:
    Shared \\My Computer\Network Variables\TC trust Array Group - network
    Shared \\128.144.90.143\Network Variables\TC trust Array Group - network

    .. where 128.144.90.143 is the IP address of the PC.

    Any thoughts?

    Sean

    I saw this post, and when I found myself with no other option, I have redefined the variables in question to the string data type and replaced all the "to variant" and "given Variant of ' functions with functions 'Flatten channel' and"The string Unflatten"respectively.  Initially, it did not work - functions "Chain Unflatten" would produce error 74, until I realized that the "data includes array or string of size? (T)"input on each 'string Unflatten" function must be set to FALSE. Wiring a constant false for each instance of "Unflatten to the string" seems to have corrected the problem.

    I have still no idea why wouldn t Variant.  Shared variables Editor allows to define a variant data type, so I guess it's supposed to?

    Sean

  • Sharing data between multiple while loops, competitor rates

    Hello

    I am trying to Exchange data between competitor while loops running at different speeds.  What is the recommended way to do this?    In practice, I have 12 indicators and 3 cards I would update (on screen) in the slower loop, although the data acquired and stored on disk in the fastest loop.  The image below is a simplified version of what really works my candidacy.

    I currently use local variables and shared to achieve this.  I heard however that local variables are evil because of their use of memory (data are copied instead of who passed by reference).

    Thanks for your suggestions,

    Adam

    Hi Adam,.

    Yes, here you go.

    Mike

  • Loading data into the list when necessary

    HI all,

    I'm a huge display of data from database in the list,

    I do not want to load all the data in one shot, I want to show also responsible, means (if the user scroll the list automatically loads the data from my db?)

    any ideas?

    Thank you

    You will need to check whether sqlite supports offsets and limits.

    http://www.SQL.org/SQL-database/PostgreSQL/manual/queries-limit.html

Maybe you are looking for

  • event 2000. hpsa_service.exe

    Error HP ID:-2146233088 at HP. ActiveCheckLocalMode.SessionManager.ActiveCheckManager.InitRegItem) at HP. ActiveCheckLocalMode.SessionManager.ActiveCheckManager... ctor() at HP. SupportFramework.Service.ACLM.AssetAgent.ExecuteAssetAgent (Boolean isFi

  • average between several sliders

    Hello With the help of another post, I managed to find the average value between 2 sliders. Now, I want to add more cursors and do the same thing. I thought that this would be not simple, but for some reason, I can't get the average value between the

  • Can't find driver

    I have HP ProBook 4510 s with Windows XP! Can you advise me - which driver should I, to make the quick launch buttons work (I mean extra - functions that should work with "fn" - button)?

  • Why can't I access Itunes store?

    Try to access itunes store and never connect. What could be the problem?

  • Install Windows 7 on the new hard drive with USB operating system recovery?

    I have an Alienware 2015 15 which does not come with a CD player. I install a new hard drive (SSD 2280 m2), so the question is how to install WIndows 7. While Microsoft offers an OS IOS for WIndows 8 download that you can put on a USB (with dell, I t