Using ListView with ArrayDataModel displays only the first element in each QVariantMap within the matrix

I have this QML who have a ListView with datasource to a full ArrayDataModel from the CPP file for creationcompleted, I loop in the table to add the hour together to appear as a label on the page, what works. However, when I want to view these items in the list, it will display only the first element of the QVariantMap within the table, no error on the log of the device. Also, triggered more does not work, but when I click it, it will have a blue border surrounding it, but the onTriggered does not fire.

Here is an excerpt of the CPP on the table fill

This-> eventsModel = new ArrayDataModel();

QVariantMap event;

event ['EventName'] = "Event1";

event ["EventHour"] = "00";

event ["EventMinute"] = "01";

event ["EventSecond"] = '02 ";

QML-> setContextProperty ("eventsModel", it-> eventsModel);

Here's the QML

{Of container

ID: eventListContainer

{To ListView

ID: eventList

dataModel: eventsModel

Use a ListItemComponent to customize the appearance of the list view

listItemComponents:]

{ListItemComponent}

type: 'point '.

{StandardListItem}

Title: 'Event' + ListItemData.EventName;

Description: "time:" + ListItemData.EventHour + ":" + ListItemData.EventMinute + ":" + ListItemData.EventSecond; "»

}

}

]

onTriggered: {}

var selectedEvent = dataModel.data (row);

var eventDetailPage = eventDetailDefinition.createObject ();

eventDetailPage.txtEventName.text = selectedEvent ['EventName'];

eventDetailPage.pickEventTime.value = picker.dateFromTime(selectedEvent["EventHour"]+":"+selectedEvent["EventMinute"]+":"+selectedEvent["EventSecond"]);

eventDetailPage.open ();

}

}

Any help would be appreciated.

Thank you.

ListView determines ItemType of the element by calling the function itemType of the dataModel. By default, an ArrayDataModel returns an empty string for this call (see https://developer.blackberry.com/cascades/reference/bb__cascades__arraydatamodel.html).

This leaves you with a few options:

(1) If you have no header and all the elements are the same, you can make

ListItemComponent {
     type: ""
     ...

(2) If you have headers or different elements, you can extend ArrayDataModel and implement your own function of itemType

(3) you can define a function of ItemType on your ListView in QML. Documentation:

ListView called DataModel::itemType() for each item in order to know the type. QML, this can be overridden by declaring the itemType function (data, row) on the ListView element. ListView then call this function instead of the function DataModel.

Here's how to create a list in QML which creates a header for all items on the high level and aStandardListItem for each item below the top level:

Tags: BlackBerry Developers

Similar Questions

  • The program panel displays only the zoom-in video

    Hello!

    I just downloaded Adobe Premiere Pro CC 2014 and I can't view the video in the Panel of the program. The source of left panel shows full display while clip that the program on the right panel displays only the zoomed video (see below). Is it possible to change this? I am trying to edit the video in accordance with a separate audio file and need to see the entire video as I edit.

    Thank you!

    adobe premiere example shot.PNG

    It seems that it is doing things and your fair sequence is not sized according to the vertically oriented video. The source monitor panel displays the whole image because it didn't fit in a sequence that does not match the press.

    You must determine which parameters you want for your sequence (e.g. 1080 p 30 fps), add media (within the parameters of sequence, you gave) and adapts the video to fit black leaving on each side. Alternately, you could just drag the video file on the "new element" in the bottom right of the project Panel to a new sequence with the settings automatically according to the media, but then you will end up either cropping when exporting, or with a record high rectangular movie that not match most of playback environments. It is a common problem with all the video side that people these days with their phones and others. The video is inherently horizontal unless you look at it on a handheld device that has no particular 'up' direction.

  • display only the photos decreased

    Hello

    How to display only the photos decreased (do not know the translation German, used in the English version of Lightroom)?

    Is this really fair as possible show the pictures decreased AND unmarked?

    Carlos

    In the grid view, choose attribute at the top. There are 3 flags. From left to right: marked, Unflagged and rejected (probably your "refused"). They can be combined. For your example, you click on the flags of the 2nd and third.

    HAL

  • We display only the columns required dynamically?

    Hi all

    I have a scenario where I have 30 columns in the rtf model. All columns will never be displayed, only a privileged few will be available for display. The output file is so see the empty columns. Now, I want to display only the columns that contain data.

    FYI - can't know what columns are made up of data until we run the report.

    Any advice.


    Thanks in advance.

    Malenfant.

    Hello

    You can use the following text:

    Column heading:
    My label

    The data in the column:
    My data

    The @column will tell XMLP wheater or not that column should be indicated.

    I hope this helps you.

    Kenneth BR

  • Restricting the views to DISPLAY ONLY the rows CreatedBy current connected user

    I want to user Oracle views - restrict the view to DISPLAY ONLY the rows CreatedBy / current OwnedBy signed / authenticated user!

    What are the different approaches, I have something with;
    setNamedWhereClauseParam, but this must be called on each ManagedBean in the constructor, as I have now!
    This approach caused the button Edit/Save which simply calls the commit to stop working. In a complete view of all the lines, there is no problem, with
    the button requesting validation the selectedRow in af: table.

    Other means?

    Thank you

    It does not appear that your view object extends the framework with custom code extension class in dealing with populating the bind variable by default.

  • How can I display only the music downloaded to my phone

    My phone displays all the music in my library and not only the songs downloaded on my phone.  I've looked everywhere and the option to display only the songs in my iPhone seems to have disappeared.

    Click the Middle drop-down menu that says artists or Albums etc, and then select only downloaded music.

  • Search bar displays only the icon. How to make it back to normal?

    Search bar displays only the icon. How to make it back to normal?

    Normally, the search bar looks like the photo in this link.

    http://www.SimpleHelp.NET/images/googlesearchicon/img03.jpg

    However, I only have the icon in the face and no space to type the search information. How can this problem be solved?
    Is it because of my Add-ons?

    Try:

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the Add-ons is the cause of the problem (switch to the DEFAULT theme: Tools > Modules > themes).

    • Makes no changes on the start safe mode window.

    See:

  • How to display only the total value in the upper part of the chart stacked

    Hi all

    I need to display only the total value at the top of the stacked chart in the report of obiee 11g. Can someone help me on this please.

    Thank you

    Hello

    Will be a little different approach suit you like the below a? Total for a day is displayed next to the attribute of the day. Here, the "daily amount" is also an attribute instead of a measure.

  • When one of my users start CC and select applications, nothing is displayed, only the arrow circling. What is c?

    When one of my users start CC and select applications, nothing is displayed, only the arrow circling. What is c?

    It is resolved, they did not have local Admin rights.

  • Creative Cloud Desktop displays only the empty box

    CC Desktop displays only the empty box. Pass the mouse over it does NOT any screen. I tried to remove and reinstall the app without success. Running Windows 7 64 bit, version of the NVIDIA GeForce GTX470 335.23 driver. Any ideas?

    Clouds WHITE http://forums.adobe.com/message/5484303 screen

    - and step by step http://forums.adobe.com/thread/1440508?tstart=0

    - and http://helpx.adobe.com/creative-cloud/kb/blank-white-screen-ccp.html

  • Newb question - displays only the first of several fields

    As a first application of Bb, I write a stopwatch and I want the larger time scale and the small milliseconds. As part of what I am trying to display several bitmap or label side-by-side fields, but when I run it using the Simulator, only the first is displayed.

    So, for example, what I want is:

    1-2: 3 4:5:6 7 8 9

    with each number in own field but what I mean is just

    1

    that is the first field. If I then use buttons they all appear in the verticalFieldManager by default in horizontalField Manager but if I use labels or bitmaps, then all I get is the first field, even if I remove the horizontalFieldManager and just use the default verticalFieldManager. I googled the question, this forum and spent several hours reading the code examples and documentation, but I have yet to understand why I can't put several fields of these types of side-by-side. I have to have something between them as separators or empty fields?

    The code that I've got so far is the following...

     public TimerView()    {     super();      HorizontalFieldManager timerField = new HorizontalFieldManager();
    
          Bitmap hour10 = Bitmap.getBitmapResource("num_1.png");        Bitmap hour01 = Bitmap.getBitmapResource("num_2.png");        Bitmap minute10 = Bitmap.getBitmapResource("num_3.png");      Bitmap minute01 = Bitmap.getBitmapResource("num_4.png");      Bitmap second10 = Bitmap.getBitmapResource("num_5.png");      Bitmap second01 = Bitmap.getBitmapResource("num_6.png");      Bitmap ms100 = Bitmap.getBitmapResource("num_7.png");     Bitmap ms010 = Bitmap.getBitmapResource("num_8.png");     Bitmap ms001 = Bitmap.getBitmapResource("num_9.png");     Bitmap colon = Bitmap.getBitmapResource("Colon.png");
    
          BitmapField bfHour10 = new BitmapField(hour10);       BitmapField bfHour01 = new BitmapField(hour01);       BitmapField bfHourColon = new BitmapField(colon);     BitmapField bfMinute10 = new BitmapField(minute10);       BitmapField bfMinute01 = new BitmapField(minute01);       BitmapField bfMinuteColon = new BitmapField(colon);       BitmapField bfSecond10 = new BitmapField(second10);       BitmapField bfSecond01 = new BitmapField(second01);       BitmapField bfSecondColon = new BitmapField(colon);       BitmapField bfMs100 = new BitmapField(ms100);     BitmapField bfMs010 = new BitmapField(ms010);     BitmapField bfMs001 = new BitmapField(ms001);
    
          timerField.add(bfHour10);     timerField.add(bfHour01);     timerField.add(bfHourColon);      timerField.add(bfMinute10);       timerField.add(bfMinute01);       timerField.add(bfMinuteColon);        timerField.add(bfSecond10);       timerField.add(bfSecond01);       timerField.add(bfSecondColon);        timerField.add(bfMs100);      timerField.add(bfMs010);      timerField.add(bfMs001);
    
            add(timerField);  }
    

    I know that this code violates probably some best practices or standards, but I intend to clean later.

    -edited for spelling

    Give it a go with images of the numbers.  You have it easy with BitmapFields, because you know how much space they need with

    getPreferredHeight() and getBitmapWidth().  Then you should be able to stick them next to each other.

    If I was doing this and who are looking for a special look at the clock, which seems to be what you are doing, I would like to have the digital icons as you do, and then set an image large enough to hold the value of the clock and in my routine of painting, select draw digital icon proper, in the right place.  As long as you load the bitmaps only once, I think it's the most effective way to do it.

    Of course, a much simpler way would be to have just a RichTextField formatted as you suggest - RichTextField because you can have two different fonts in a single field.

  • Windows displays only the first page of a multipage document - solutions?

    I recently installed an HP printer on my laptop with the help of a support HP online technician, but only the first page printed - the other eight were empty.

    Also, one-third of the right side of the document (electronic mail) was chopped up, while the leftmost column prints (Windows Live/Hotmail/Hotmail address) in the full preview and printing is not available since I upgraded to IE8 on my laptop HP under Vista Home Premium.

    How do I Center this document so that it will print correctly, and can I add the "Print preview" option in my Google toolbar, or install an another toolbar that includes?

    Thank you!

    http://welcome.HP.com/country/us/en/support_task.html

    Go to the above link > 'See support and troubleshooting information' > key in your number of printer > there is the use of manuals there.

    For more information, contact HP:

    http://welcome.HP.com/country/us/en/contact_us.html

    See you soon.

    Mick Murphy - Microsoft partner

  • Problem with player search - only the First Instance is highlighted

    I use WIN 8.1 with Adobe Acrobat Reader DC [15.10.200056.167417 'updated 12/18/15"indicated in the program properties] as my default PDF reader.

    Until recently, I was able to do a search of words/texts of .pdfs using CTRL-F, who showed me every instance highlight of this word.  I would simply hit 'find' several times.  These days, only the first occurrence of the word is highlighted.  Along the right margin are yellow "tics" that, in my opinion, indicate the existence of other occurrences.

    If something has changed in the drive?  Some can tell me how to regain the ability that I hope

    mikec2222 wrote:

    Bernd - Do I understand you though, when you search for "" this document, you can find a second occurrence of "the" highlighted by pressing 'find' or 'next' or 'enter' again?  If this is true, my copy of AA CD player must be faulty.  I can't wait to see your response.

    It's true.

  • Master page link to a details page displays only the first record

    Hello

    Could someone tell me please how to fix this problem:

    I have a master page that lists all users of my, and I have links next to them to take them to the specific user details. However, the links of all other records only show details for the first record.

    This is the link that is supposed to brings me to the details page:

    < a href = "patientlist2.php? Patient_id = <? PHP echo $row_rsPatients ["Patient_id"];? > "> <?" PHP echo $row_rsPatientlist ["Patient_id"];? > < / a >

    I have the same problem when you try to update the files, only the first record will appear.

    I'd appreciate any help.

    Thank you

    There is probably something wrong with your recordset. Test the query in the window of recordset for the generation of game records to ensure that you get the results desired of the recordset before placing and repeat on the page.

  • V4.1.1.887 Data Modeler - 8 opens and displays only the areas of my design of the file

    Yesterday I was working in my design of the database with data v4.1.1.887 maker and then saved work in file and closed the application.

    And today, something bad happened, the application opens my design but only displays a list of the areas that I created for my design.

    I can't display in the Explorer window of my: logic model, structured data types that I created, process and business information model diagrams.

    I migrated to v4.1.1.888 Data Modeler and the problem persists, then looked at the previous issues resolved in the forum and found an answer to a similar case of problem

    4.0EA2 (v4.0.0.820) Data Modeler after accepting migration from previous installation of v3.3.0.747 DM preferences settings.

    So I deleted the files preferences (I use Windows Vista) C:\Users\username\AppData\Roaming\Oracle SQL Developer data Modeler\system4.0.0.887 and 8, but the problem persists there.

    I also looked at the directory of the files that make up my design, and the size and the number of them seem to be without significant alteration I looked a few days ago.

    Can give me a solution to this problem?

    Hi David,

    After some research and testing, I finally solved the problem. I did the following:

    I deleted the text value from my memory of java in the java Control Panel of windows,

    I deleted the 4.1.1. C:\Users\username\AppData\Roaming\datamodeler\4.1.1 carpet

    I changed the memory to-Xmx2048m in datamodeler.conf in the datamodeler\datamodeler\bin folder

    then tried to start the Data Modeler but never value began, then reduced to-Xmx1024m and he began

    and not migrated preferences the next time I opened the Data Modeler and set preferences with utf-8 (I noticed it comes by default with coding cirillic)

    I closed and restarted datamodeler the external newspaper and made settings worked very well.

    Then I started to test with 3 versions of my design work for this month, their sizes are 5MB, 10MB, 10.1 MB the recent

    I opened and closed each oldest works to the latest and the oldest two worked fine without error in the external journal.

    However, the recent open all the drawings but I found an opening in the external log error:

    2015-07-24 19:46:31, 685 [Thread-25] ERROR XMLTransformationManager - cannot parse list of objects: C:\Systems\Software\Event-Cloud\Workspaces\Des-Database\v1.0.0.1-whole\dbd-150721-1\v100-dev\businessinfo/Objects.local

    Oracle.Xml.Parser.v2.XMLParseException; lineNumber: 1; columnNumber: 1; Start of the element root waited.

    at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:326)

    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:463)

    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:404)

    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:245)

    at oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:175)

    at oracle.dbtools.crest.model.metadata.XMLTransformationManager.getObjects(XMLTransformationManager.java:3236)

    at oracle.dbtools.crest.model.metadata.XMLTransformationManager.openDesignPartManyFiles(XMLTransformationManager.java:3692)

    at oracle.dbtools.crest.model.metadata.XMLTransformationManager.openDesignPart(XMLTransformationManager.java:3545)

    at oracle.dbtools.crest.model.design.Design.openDesign(Design.java:1438)

    I checked the Objects.local file and it's there. then I closed the design without saving changes and ended Datamodeler application.

    Then I opened the Objects.local with Notepad ++ and I found and structure XML and the data that I wrote in my family business contact section has disappeared from the design

    I restarted Datamodeler opened and closed my recent design and that article accompanied by white, the datamodeler clos

    Search the file and noted increased its size 153 MB so she tried to open it with notepad ++ but it crashed.

    So I compared the previous Objects.local files and they are content equal and I did not modify this related part and the IDS are the same.

    I then removed the big Objects.local bad and replaced it with the previous version of the file and then started to Datamodeler

    and my recent design opens and closes fine without errors in the external journal.

    I think your application when open a file and found a critical error Stops to load the file and reports the external newspaper but if a non-critical error

    It displays the design and the log window does not show something goes wrong, in my case, I was not aware of this.

    Kind regards

    Julio.

Maybe you are looking for