What is correnct how to use GroupDataModel custom inside a qml?

Hello.

Got this code qml

    Tab {
        title: qsTr("Friends")
        content: NavigationPane {
            Page {
                content: ListView {
                    id: friendsView
                        dataModel: friendsModel
                    listItemComponents: [
                        ListItemComponent {
                            type: "header"
                            StandardListItem {
                                title: friendsModel.header
                            }
                        },
                        ListItemComponent {
                            type: "item"
                            StandardListItem {
                                title: friendsModel.first_name
                                description: friendsModel.last_name
                            }
                        }
                    ]
                }
                onCreationCompleted: {
                  if (friendsModel){
                    console.log("Here is non 0 model")

                  }
                }
            }

        }
    }

And this C++ code

    FriendsApiService* friendsApi = new FriendsApiService();
    friendsApi->getFriendsList();

    QmlDocument *qml = QmlDocument::create("asset:///main.qml")
    .parent(this);

    qml->setContextProperty("friendsModel", friendsApi);

    AbstractPane *root = qml->createRootObject();

    app->setScene(root);

It's interesting because I see my virtual functions in groupdatamodel (childcount() and data()), debugging messages

but then was an error in the console: "Reference error cannot find varialable friendsModel.

So as a result, I got 5 (cause my model data has 5 rows) empty strings in my ListView.

In your StandardListItem you use ListItemData.first_name, not friendsModel

Tags: BlackBerry Developers

Similar Questions

  • Shredder-what is and how to use it?

    This Shredder suddenly appearde wheb I went ti download/recycle something. I was not prior notification of such program.  There is no guidance on what it is or how to use it.

    Clues would be certinally help me.

    THX * address email is removed from the privacy *

    Hi Laura,

    1. what operating system is installed on the computer?
    2. have you made changes on the computer recently?

    The shredder (also known as the shredder or Oroku Saki) is a fictional character and the main antagonist of the Teenage Mutant Ninja Turtles franchise. At one time or another in each incarnation of the TMNT stories, it has been the archenemy of Splinter and the turtles. It is also known as the leader of the foot Clan.

    Shredder software is used to prevent a restoration of files deleted from your drive, you can use easy-to-use file shredder software permanently delete files allows you to permanent delete files from your computer, hard disk, USB stick, stick of memory, etc. It is absolutely impossible to restore any data that has been erased using delete files permanently. Some viruses spoof as real program and is installed on the computer.

    Note: using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

  • How to use my custom defiend function

    Dear all,

    I simply create a new custom set function that I send him a whole month and return name.
    The function registered successfully. and everything is ok, the newspapers are ok

    My question: how to use my @TOSTRING CDF

    the following code for the java class
    --------------------------------------------------------------------------------
    import java.lang. *;
    Import Java.util;
    import java.text.DateFormatSymbols.
    class toString {}

    public static String fromInt (int m)
    {

    return new DateFormatSymbols () .getShortMonths () [m-1];

    }

    }

    ------------------------------------------------------------------------------


    I tried the following and check syntax result successful and executed, but now


    VAR x = 2;
    'Project status' = @MEMBER (@CONCATENATE (@TOSTRING (x), '200'));


    Please advice

    Try to write a fix and check that @TOSTRING (x) is back, ex:
    DIFFICULTY (@MEMBER (@CONCATENATE (@TOSTRING (x), "200"))
    ;
    ENDFIX;

    Or

    Fix (@Member (@TOSTRING (x)))
    ;
    ENDFIX;

    You will find a line in the newspapers saying:
    Expression [@MEMBER (<>)]...

    See you soon... !!!

  • How to use a custom in OBPM jsp taglibs?

    Could someone, please, explain to me the steps on how to use a taglib custom inside OBPM 10 g with jsp?
    I created a custom taglib, it works with other projects (with jdeveloper, for example), but I'm missing something to make it work with Obpm.

    Thank you

    Make sure you copy the .tld and .jar files appropriate for the tag library in the directories for the BPM execution:

    Copy the .tld into /webapps/workspace/WEB-INF

    Copy the jar file of taglib in /webapps/workspace/WEB-INF/lib

    Make sure you restart the workspace after making the above changes. If you are using enterprise, you must rebuild and install le.war/.ear to the workspace and to redeploy.

  • How to use a function inside the package?

    Hello

    You will need to convert weight unit of kilogram kips when filling out the weight values into a temporary table. In our database, schema there is a function called convert_units is available.
    How could I use this feature in my package? My package is also resides in the same database schema.

    Here, I pasted the function.
         convert_units
       (
         in_base_unit_id       NUMBER,
         in_conversion_unit_id NUMBER,
         in_value              NUMBER
       ) RETURN NUMBER AS
    CURSOR unit_cur IS
      SELECT *
      FROM units_conversion
      WHERE base_unit_id = in_base_unit_id
        AND conversion_unit_id = in_conversion_unit_id;
    unit_rec unit_cur%ROWTYPE;
    BEGIN
      OPEN unit_cur;
      FETCH unit_cur INTO unit_rec;
      IF unit_cur%NOTFOUND THEN
        unit_rec := NULL;
      END IF;
      CLOSE unit_cur;
      RETURN (in_value+unit_rec.pre_adjust_add)*(unit_rec.rate);
    END convert_units;

    Hello

    It seems that the first two arguments of this function are ID in the units_conversion table. If you know this id = 1234 means kilograms, 9876 means kips, then you can do things like:

    wt_kips := convert_units (1234, 9876, wt_kilograms);
    

    or

    INSERT INTO tmp_table ( ..., weight_val,                               ...)
           VALUES           ( ..., convert_units (1234, 9876, wt_kilograms), ...);
    

    I can't just look at the code which could be any valid ID. I'm not even sure of the order of the arguments. I hope you have instructions on how to use the function.

    If the function is in a package named pk_xyz (a different package to the one in which you call it), add the name of the package, like this

    wt_kips := pk_xyz.convert_units (1234, 9876, wt_kilograms);
    
  • How to use the custom function to put in shape of line chart Axes?

    Hello...

    I use a graphic line which the axis value is vary from 0 to 50000. It is a number which he gets from its dataProvider. I want to format it and show it as

    $50,000

    $40,000

    $30,000

    $20,000

    $10,000

    $0

    Instead of

    50000

    40000

    30000

    20000

    10000

    0

    Here is my code linechart:

    < mx:LineChart id = "revTimeLineChart".
    Width = "100%" height = "100%".
    showDataTips = "true" >

    < mx:horizontalAxis >
    < mx:CategoryAxis id = "lcCatAxis" categoryField = "name" / >
    < / mx:horizontalAxis >

    < mx:series >
    < mx:LineSeries id = "ls" yField = "income" displayName = "Recipes" showDataEffect = "{slideIn}" / > (yField, this is what I want to do a format...)

    < / mx:series >

    < / mx:LineChart >

    Can you please let me know how can this be achieved?

    See you soon!

    Deepak

    Hello

    you need a labelFunction in AxisRenderer.

    See the example in the documentation

    http://livedocs.Adobe.com/Flex/3/langref/MX/charts/AxisRenderer.html#includeExamplesSummar y

  • How to use the custom scale

    Hello

    I use the version of LabVIEW 2013. In my program, I used DAQmx create scale (linear). VI before the DAQmx create Channel.vi

    I have a 4 to 20mA current signal to be converted into pressure. It's I want any current value comes put DAQmx read to be subtracted by 4mA and then multiplied by 0.375.

    If we see equation y = mx + c, and then my x-value data from reading DAQ, m will be 0.375 and orderly will be - 0.0015

    If I feed these scale values create, I do not receive correct data. It is that I gave the slope as 0.375 intercept and y as - 0.0015 to create Scale.vi

    Is not the right way.

    If I try the way ordinary read DAQmx exit, then subtracting 4mA and then multiplying 0.375, I get correct pressure value.

    So if I want to the regular way or what I have to do scaling create to manage this calculation. Let me know. Thank you

    Hemagopal wrote:
    I have 6 bar working pressure of 4 to 20 my. Create scale can be used?

    If you are off to a factor of 1000.  Your scale should be y = 375 x - 1.5

  • How to use two custom on one screen fields

    Hello friends,

    I'm trying to customize LabelField and EditField. Both performed well individually in separate projects. Now I want to put them in the same project, same screen. Please help me.

    My Code is as attaché

    // BBEdit field class...customized EditField
    
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.component.EditField;
    
    public class BBEditField extends EditField {
    
        public BBEditField() {
            super("","Trial");
    
        }
    
        protected void layout(int width, int height) {
            super.layout(width, height);
            setExtent(width, height);
        }
    
        protected void paintBackground(Graphics graphics) {
            // TODO Auto-generated method stub
               graphics.setColor(Color.BURLYWOOD);
                graphics.clear();
    
            super.paintBackground(graphics);
        }
    
    }
    
    //BBLabelField class.. customized LabelField
    
    package mypackage;
    
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.component.LabelField;
    
    public class BBLabelField extends LabelField {
        private String text;
        private int colorOfText;
    
        public BBLabelField(String text, int colorOfText) {
            super(text);
            this.text = text;
            this.colorOfText = colorOfText;
    
        }
    
        protected void layout(int width, int height) {
            super.layout(width, height);
            setExtent(width, height);
        }
    
        protected void paintBackground(Graphics graphics) {
            graphics.setColor(colorOfText);
            graphics.clear();
            super.paintBackground(graphics);
        }
    
    }
    
    // Actual use of both the classes..not working well together
    
    public final class MyScreen extends MainScreen
    {
        /**
         * Creates a new MyScreen object
         */
        public MyScreen() {
            // Set the displayed title of the screen
            VerticalFieldManager vfm = new VerticalFieldManager();
            BBLabelField myLabel = new BBLabelField("dummytext",Color.BROWN);
            BBEditField editField1 = new BBEditField();
    
            editField1.setText("This is Non-Editable");
            editField1.setLabel("Name : ");
            editField1.setEditable(false);
    
            vfm.add(editField1);
            vfm.add(myLabel);
    
            add(vfm);
    
        }
    }
    

    Thank you

    remove the sublayout method, it does not have something useful.

  • DW028 of Error Message When you try to go back and download Muse 2014 (what I knew how to use)

    The latest version of reactive of Muse is a mountain too high to climb.

    I want to go back to what I know - MUSE 2014.

    But when I try to download the previous version, I'm hung upward and an error message:

    ERROR: DW028: InstallOperationsQueue: instruction set is empty

    ERROR: DW028: InstallOperationsQueue: instruction set is empty

    FATAL: DW028: could not open the queue of the operation

    It happens on both my Mac laptops.

    Thank you.

    Hi Jcmanheimer,

    Please remove Muse CC completely from your machine - use of the Adobe Creative Cloud cleaning tool to solve installation problems

    After that install it again thanks to the creative cloud desktop application.

    See, Installation and launch of the errors in the log. Adobe Creative Suite 6, Adobe Creative Suite 5.5, Adobe Creative Suite 5

    If the problem persists, please analyze the log files to find out the root cause of the problem: Troubleshooting Adobe Creative Cloud install problems with log files

    Please write back to us, if it can help.

  • How to use a custom comments template?

    Hi, I'm using

    {module_ratingfeedback template="/auto/templates/comments.tpl}"

    Model renders {{items}} as '2 System.Collections.Generic.Dictionary (System.String, System.Object)
    Restores {{[0]}} as [pendingComment], [date, 09/03/2016 14:21:19] [body, large vehicle] [country], [flagUrl,] [fullName, Anonymous] [Web site] [postUrlWithHost, http://www.yarmarka.kz] [note, 3]

    But I can't loop through {{items}}.

    {% for item in items %} TEST {% endfor %}

    returns nothing.

    What I am doing wrong?

    Hello

    According to the docs, the module_ratingfeedback will make your comments for an article.

    So there will be everything to loop through.

    What exactly are you trying to achieve? Can the {tag_commentspaged, collection model = 'collection_name' = ""} help?

  • What is and how to use the dell owner connector 6-pin

    I have a Dell Optiplex GX280 minitower with a 250W dell power supply. I can't understand what good is it for or the use of this connector dell owner 6-pin (additional adapters or something). Impossible to find reliable info on this topic, maybe you can help me with this one? Just in case, I've attached a picture to me clear.

    Mini-Tower (page 112) The DC power supply connector pin assignment:

    DC Power Connector P4

    Identification number

    The signal name

    Wire 18 AWG

    1

    N/C

    2

    COM

    Black

    3

    COM

    Black

    4

    + 3.3 VDC

    Orange

    5

    + 5 VDC

    Red

    6

    + 12 V DC

    Yellow

  • How to use if condition inside a statement case?

    Hi all

    It's my code and the error. Please help me.

    SQL > select case when value (1000) then null
    2 when the user in ('ABC'), then the user
    3 when area ("Denver") then
    4. If value = 2000 then 'Service1 '.
    5 other value = 3000 and then "Service2.
    6 end if
    7 another null
    8 end as service_usoc_ref num_code;
    If main = 2000 then "Omaha".
    *
    ERROR on line 4:
    ORA-00905: lack of keyword

    Thank you...

    Try this...

    select
         case
              when value in (1000) then null
               when user in ('ABC') then user
               when area in ('DENVER') then
                      decode(value, 2000 , 'Service1', 3000 ,'Service2')
               else null
          end as num_code
    from service_usoc_ref;
     
    

    Here is the reference for more information on Decode for your use:
    http://www.techonthenet.com/Oracle/functions/decode.php

    Kind regards
    Lifexisxnotxsoxbeautiful

  • How to use PF_AppGetColor() indeed custom?

    Hello

    I am able to use PF_AppGetColor (PF_App_ColorType, PF_App_Color) and get the AE color required for use in the CEAP. But I'm not able to find a way to use PF_AppGetColor() in my custom effect. For now I'm connect to CEAP and get the required color. Please tell me how to use indeed custom PF_AppGetColor().

    Thank you

    Dheeraj.

    I use it in an effect.

    This comes directly from my code.

    Suites. AppSuite3()-> PF_AppGetColor (PF_App_Color_HOT_TEXT & appColor1);

    What happens when you try to use it?

  • How to use the plugin Cordova customized with AEM Mobile?

    Hello

    I explored the basics of the AEM Mobile over the last days and also tried to use some plugins Cordova mentioned in the Plugins to the application tab. Now, I would like to know how to use a custom Cordova plugin or plugin other than those mentioned in this list in my application.

    Is it possible to achieve today? If Yes, please provide me with the markets / pointers to all documentation which explains the same thing.

    Custom plugins support is not yet available, but on the road map

  • applicationContext remains "null" after using the custom url scheme to launch the app

    Hello

    I am currently working on a DPS application for a customer who wishes to use its own authentication system.

    The client system is implemented so that they send the valid token to a URI with a custom method.

    By setting the same pattern custom in my app DPS constructor, I can get the app from the login window.

    What is described in the library of DPS & Api store 2.32 documentation, I understand that

    " adobeDPS.configurationService.applicationContext must contain several variables associated to how the viewer was started or enabled:" ","this class represents the context under which the application is launched '


    However, in my application when I try to see what contains the applicationContext, the object is always 'null '. It doesn't matter if I started the application by clicking on its icon or if it was launched using the custom uri scheme.


    Is this a bug or am I missing something here? I really need this token.

    Hello

    After being stuck for a while trying to work with the url of my client for usage, I finally tested it with a modified version and have found the cause of the problem.

    Work of first information provided by a colleague who was apparently not detailed enough for the customer asked me to use a url of the form App. scheme://auth/#token=...

    It turns out that this kind of url can start or bring the app to the front, but applicationContext remains empty.

    My tests using a url in the same form as you suggested (eg. app. scheme://v1/slot/library) can trigger the app or transmit data.

    The documentation available in the SDK library & shop and article on how to use a custom template is very vague on what formats link actually works, and how we can vary with it.

    A breakdown of official links to pieces, that the parties do and what items can be modified (for example ' / appstate') within the API documentation would be a great help for developers, I think.

    Kind regards

    Lorin

Maybe you are looking for