GroupDataModel is not sorting when the data are added to Json

If I have an empty Json and I add data to him one by one, everything works just fine, but when I have a data in Json it sort. Let's say that this is my json:

[
   {
      "DateCreated" : 1383137332,
      "DateToFinish" : "1383137400",
      "Description" : "Task 3",
      "Status" : "1",
      "taskId" : "3"
   },
   {
      "DateCreated" : 1383137327,
      "DateToFinish" : "1383137400",
      "Description" : "Task 2",
      "Status" : "1",
      "taskId" : "2"
   },
   {
      "DateCreated" : 1383137321,
      "DateToFinish" : "1383137400",
      "Description" : "Task 1",
      "Status" : "1",
      "taskId" : "1"
   }
]

sortingKey is set for "taskId" and sortedAscending is set to false "(false) setSortedAscending" but in the ListView, it indicates in order as 'Task1, Task2, Task3' growing. I filled out model json with:

 QVariant list = jda->load(QDir::currentPath() +
                             "/app/native/assets/test.json");

    this->insertList(list.value());

In addition, after I have load and insert json to the model, when I try to add a new model element, it adds properly in its place. He would add "task4' with the id" taskId: 2 "at the top of the JSON...»

EDIT: "jda" is ' bb::data :: JsonDataAccess'

Put 'setSortedAscending (false)' after insertion has solved, but I'll leave this open for explanation.

Tags: BlackBerry Developers

Similar Questions

  • Field containing average function works only when the data are engaged on the same page. Does not work for fields on other pages.

    I'm having a problem with a field defined to calculate the average of eleven points fields (points 1 to 8 on page 1-9-11 on page 2). My original question was that it could exclude fields of points when they do not have information entered and adjust the average calculation (number of "divided by") accordingly.

    I had someone write JavaScript code for him, but I just found a small problem I don't know if it's something in the code or what the person who originally wrote the script cannot understand it either and suggested that I have post here.

    The middle area (located on the 2nd page of the pdf page two) seems to work exclusively with precision if at least one of the points of the fields on the 2nd page, 9, 10 (and 11) are engaged with the data. No values entered on the first page and only the first page, are for some reason any dividing by a more than expected. For example, if I fill the boxes 1, 2 and 3, it divides the total by four. If I filled just box 7, it halves. If I fill all 8 boxes on the 1st page, it divides by nine. It is corrected as soon as I get the points in one or more of the three boxes on the 2nd page points, suddenly the overall average is accurate. But if boxes 9, 10 and 11 contain no points, then the average is still inaccurate because the number of ' divide by "he uses is one more than what it should. I can't understand how to attach the form to this post, so I downloaded on Dropbox: Dropbox - used Evaluation.pdf.

    Under the direction of State: javascript came work to exclude the empty boxes when the points are entered in one of the three points of fields on the 2nd page (and more), but the average function is not accurate because it adds 1 to the number of ' divide by "in the calculation of the average If the points are only entered into the fields on the 1st page.

    Here's the code I entered in the 'Custom calculation Script' box in the 'Calculate' tab of the Properties menu of Test field:

    Initialize variables

    var num = 0;

    var sum = 0;

    Browse the input fields

    for (var i = 1; i < 12; i ++) {}

    var f = getField ("points." + i);

    If {(f.valueAsString)

    increment the counter to non-empty field

    NUM ++;

    Add the value of the running total field

    sum += + f.value;

    }

    }

    Calculate the average

    If {(num)

    Event.Value = sum / num;

    } else {}

    All fields are empty, then the empty value

    Event.Value = "";

    }

    I do not see that. Add the code of script debugging will display the results that each field is completed:

    Initialize variables
    var num = 0;
    var sum = 0;

    Browse the input fields
    for (var i = 1; i)< 12;="" i++)="">
    var f = getField ("points." + i);
    If {(f.valueAsString)
    increment the counter to non-empty field
    NUM ++;
    Add the value of the running total field
    sum += + f.value;
    }
    }
    Debug - display results as the form is filled;
    Console.Show
    Console.println (sum + "/" + num + "=" + sum/num);
    end of debugging;
    Calculate the average
    If {(num)
    Event.Value = sum / num;
    } else {}
    All fields are empty, then the empty value
    Event.Value = "";
    }

  • Font size set to auto but sounds different when the data are populated compared to typed manually

    I have a form where all the size of the font of fields is set to auto. When data are filled in the form in a custom program the font size appears different to the name and first name fields. When the same names are typed manually in the form (not filled in the custom program) the font size remains uniform. There is no coding in the personalized program to manipulate the fonts or the font settings. What could be the cause of the change in the appearance of the font size. Another interesting is that after the program fills in the data, I can click in the areas affected by this problem and the police will change to what it should be but set in the right size once I have quit the field. I also see that some fields when filled will not be characters fat even if the police is set to a bold font.

    When a font of a field is set to Auto, Acrobat/Reader dynamically adjust the font size to match what is entered. When not using Acrobat/Reader to populate a field, it belongs to the program to properly set the font size based on the value of the field. Adobe does not publish any algorithm they use to determine the exact size (depending on the font used and the coordinates of field), so that a third party should use a better estimate (or not even trying at all), that looks like what is happening in your case. When you click within a field by using Acrobat/Reader, the font size is adjusted dynamically, but because the value of the field does not change, it is not defined when the field loses focus.

    A possible solution would be to use JavaScript to record all the field values, reset the form and then fill in the form using the saved values, this would cause Acrobat correctly define the appearances of field.

  • Conditional liquid do not print when the conditions are met.

    I build a simple menu in British Colombia and for the purpose of this project, I'm going to be exposing this menu without using Module of menu in British Colombia. I use the following code:

    {% If globals.user.isLoggedIn contains 'true' %}}

    < id = "my-account-link" li > < a href = ' / my account "> < i class ="fa fa-diamond"> < / i > < span class ="-animate "> my account </span > < /a > < /li >

    < id li = "settings-link" > < a href = "/ my account-#settings" > < class i 'fa fa-sliders' = > < / i > < span class = "-animate" > my settings </span > < /a > < /li > ""

    < id = 'link-support' li > < a href = "/ my account/help" > < i class = "fa-fa-question-circle" > < / i > < span class = "-animate" > support </span > < /a > < /li >

    < id li = "logout link" > < a href = "/ LogOutProcess.aspx" > < class i 'fa-fa-sign-out' = > < / i > < span class = "-animate ' > Log Out < / span > < /a > < /li >" "

    {% other %}

    < id li = "connection-link" > < a href = "/ login" > < i class = "fa fa-sign-in" > < / i > < span class = "-animate" > Login / / Sign Up </span > < /a > < /li >

    {% endif %}

    I have used before with other snippets of code and this liquid condition print very well. For some reason, when I test the newspaper, the State still shows the wrong code even when I look through the JSON printed in the console object and the object user loggedin contains the value Boolean 'true '. Sort of at a loss as to why it is not printing when the user connects. Really want to use liquid on it and do not have to revert to the version JS of the hiding items.

    Thanks in advance to all! Best wishes!

    Well, I feel stupid, I was following the copy and the tutorials BC and pasted. Realized that I had to use operators such as "is" appropriate and «!» = ». I fixed it now

  • Remote PC stops responding when the lines are added to a multiline textbox

    Hello

    When connected two RDP connections and multiline textbox is visible and always up-to-date (e.g. time real record on the screen), then all other processes and threads are suspended on the remote PC. For example, the task manage does not refresh, the clock stops, if you have a few applications running on this PC Server/services so their customers will get the writing/connect timeout errors, etc.

    to reproduce this problem:

    1. create a test application simulating recording in real time on the screen. For example, create a new GUI application (for example, in visual basic, delphi, etc.), several (for example six) textbox, control and set multiline = true (or use TMemo components in delphi), add the button and code to add rows in a loop (for example 200 iterations) these textbox/TMemo controls (see the sample code below). Build the executable

    2. have three PC of loan. The first connect to second via RDP and from there linking to third parties via a second RDP connection. Third PC start test application, that you created in step 1. While the lines are added to the multiline/TMemo text box, try to do something with this PC, for example open the Task Manager, check how it is refreshing, open clock and note how seconds are proliferating, try to connect to some services from another PC (shared disk for example, ftp, web, etc.) and see how to answer they are

    Windows 2000 seems to be ok, xp, 7, Server 2003/2008 have some problems

    is there something that we could do to make the third-party application with real-time logging to the multiline/TMemo text box does not slow down or suspend our services that are running on the same PC, when someone connect via RDP? also, it would be great if microsoft could fix this problem

    example code:

    For i As Integer = 1 to 200
    Dim s As String = «»
    J As Integer = 1 to 10
    Convert.ToString (i) & s = s & ""
    Next J
    TextBox1.AppendText (s & Chr (13) & 10)

    J As Integer = 1 to 10
    Convert.ToString (i) & s = s & ""
    Next J
    TextBox2.AppendText (s & Chr (13) & 10)

    J As Integer = 1 to 10
    Convert.ToString (i) & s = s & ""
    Next J
    TextBox3.AppendText (s & Chr (13) & 10)

    J As Integer = 1 to 20
    Convert.ToString (i) & s = s & ""
    Next J
    TextBox4.AppendText (s & Chr (13) & 10)

    J As Integer = 1 to 20
    Convert.ToString (i) & s = s & ""
    Next J
    TextBox5.AppendText (s & Chr (13) & 10)

    J As Integer = 1 to 20
    Convert.ToString (i) & s = s & ""
    Next J
    TextBox6.AppendText (s & Chr (13) & 10)
    Next I

    var
    i: Integer;
    s:string;
    Start
    for i: = 1 to 200 start
    s:='';
    While length<20 do="" s:="s+intToStr(i)+'">
    glMemo1.Lines.Add (s);

    While length<40 do="" s:="s+intToStr(i)+'">
    glMemo2.Lines.Add (s);

    While length<60 do="" s:="s+intToStr(i)+'">
    glMemo3.Lines.Add (s);

    While length<80 do="" s:="s+intToStr(i)+'">
    glMemo4.Lines.Add (s);

    While length<100 do="" s:="s+intToStr(i)+'">
    glMemo5.Lines.Add (s);

    While length<200 do="" s:="s+intToStr(i)+'">
    glMemo6.Lines.Add (s);
    end;

    Thank you
    Paulius

    http://social.technet.Microsoft.com/forums/en-us/itproxpsp/threads

    you might do better at the forum above. Good luck. :)

  • How can I create a chart that creates new series each year when the data are not collected on a daily basis?

    I collect numbers "occasionally" of my solar system and to create a standardized chart that shows that the generation on an annual basis, so I can compare fall in the fall of each year, etc..

    Because the information is not strictly 'daily' (just whenever I get to it), I don't know how it normalize for several years.

    For example, if I had

    Date - Kw/day

    15/01/10 - 14

    03/04/10 - 18

    18/04/10 - 17

    01/06/10 - 19

    21/09/10 - 15

    03/12/10 - 9

    07/02/11 - 13

    02/05/11 - 16

    17/08/11 - 18

    01/11/11 - 12

    02/11/11 - 12

    05/01/12 - 9

    04/06/12 - 12

    and so on.

    What I'd like to see is a line graph for each year from January to December with these datapoints on it. I have much more "incremental data" that I presented above, but it's on "random dates" during the last 8 years, and I'm just trying to see how each year compared to other years.

    To be at the front, I tried to understand how this in Excel as well, but he could not understand where the other.

    DRM for any tips/tricks/tips!

    Steve

    This might work for you...

    I placed your data in a table named "Data."

    Create a second (in this example, titled 'Table 1')

    In the table 'Table 1' months are in the first column and the first row (which is a header row) contains the years - add columns to add new year:

    B2 = if (SUMIFS (data: $B, data: $A, "> =" & (B$ 1, $A2, 1), DATE data: $A, "<" & EOMONTH(A1,0) will GET (DATE B$ 1, $A2, 1, 0) "" "") > 0, SUMIFS (data: $B, given: $A, "> =" & (B$ 1, $A2, 1), DATE data: $A, "<" & EOMONTH(A1,0) will GET (DATE B$ 1, $A2, 1, 0) "" ""), "")

    It's abbreviation dethrone select cell B2 and type (or copy and paste it here) the formula:

    = IF (SUMIFS (data: $B, data: $A, "> =" & (B$ 1, $A2, 1), DATE data: $A, "<" & EOMONTH(A1,0) will GET (DATE B$ 1, $A2, 1, 0) "" "") > 0, SUMIFS (data: $B, given: $A, "> =" & (B$ 1, $A2, 1), DATE data: $A, "<" & EOMONTH(A1,0) will GET (DATE B$ 1, $A2, 1, 0) "" ""), "")

    Select copy of cell B2

    Select the cells B2 at the end of F13, dough

    now select cells A2 through F13 and add a graphic (the XY scatter diagram)

    Add new year add one (or more) new columns for "table 1", then add the year to the top:

    Now alone, click the chart to activate the chart.  then click on the button 'change data references '.

    now, drag the data reference control handle to the right to add the new year to the table:

    You can add several years to the time, so you don't have to it very often

  • How to remove line empty when the data are not for a text field

    I created a PDF with Acrobat Pro 11 model. This model has an address of the employer with the address line 1, address line 2, city, State, zip code, country. The requirement is to show address line 1 and line 2 address in separate lines and address line 2 cannot be present always. If address line 2 is not present then the PDF should not show a blank line. How do I get there?

    These data are populated through xml by a publisher of BI. New line characters do not work.

    Appreciate your help on this.

    Hi sprphoto123,

    If you do not enter data in the text field 2 then you can set the form field property to is not mandatory, but if you want to disable the 2nd text field, you can add a check box in front of it to turn off the field. This can be achieved using JavaScript.

    Kind regards

    Nicos

  • Trying to update a table in a second table when the data are different

    Hello;
    I have a the same table in two databases. The database are connected with a DB link. I'm trying to update one table based on the data in the second table when the EMP_ID is but the name does not match.

    The table will look like:
    Table name: EMP
    EMP_ID
    LAST_NAME
    FIRST NAME
    MIDDLE_INITIAL

    My SQL is:
     
    update EMP TARGET 
        set (TARGET.LAST_NAME, TARGET.FIRST_NAME,TARGET.MIDDLE_INITIAL) = ( 
            select SOURCE.LAST_NAME, SOURCE.FIRST_NAME, SOURCE.MIDDLE_INITIAL 
            from EMP@OTHER_DB SOURCE where 
            TARGET.PHYSICIAN_ID = SOURCE.PHYSICIAN_ID 
            and TARGET.LAST_NAME <> SOURCE.LAST_NAME); 
    This refers to a number of update of all lines not the bit I want.

    Any help would be great!

    Hello

    Sky13 wrote:
    Hello;
    I have a the same table in two databases. The database are connected with a DB link. I'm trying to update one table based on the data in the second table when the EMP_ID match

    Do you doctor_id?

    but the name does not match.

    The table will look like:
    Table name: EMP
    EMP_ID
    LAST_NAME
    FIRST NAME
    MIDDLE_INITIAL

    My SQL is:

    
    update EMP TARGET
    set (TARGET.LAST_NAME, TARGET.FIRST_NAME,TARGET.MIDDLE_INITIAL) = (
    select SOURCE.LAST_NAME, SOURCE.FIRST_NAME, SOURCE.MIDDLE_INITIAL
    from EMP@OTHER_DB SOURCE where
    TARGET.PHYSICIAN_ID = SOURCE.PHYSICIAN_ID
    and TARGET.LAST_NAME <> SOURCE.LAST_NAME); 
    

    This refers to a number of update of all lines not the bit I want.

    Any help would be great!

    There is no WHERE clause in the UPDATE statement, so that each row in the target table will be changed.
    If you only want to change the lines that have a match in the source table, then add a WHERE clause (perhaps "WHERE EXISTS (...)) with a subquery miuch very similar to the one you already have), or use the MERGER instead of UPDATE.

    If you want to know, post CREATE TABLE and INSERT statements to recreate the tables they existed before the UPDATE and also post the contents of the table changed after the UPDATE.
    Always tell what version of Oracle you are using.

    Maybe you want something like this:
    {code}
    MERGE INTO the emp target
    WITH THE HELP OF)
    SELECT o.emp_id
    o.last_name
    o.last_name
    o.middle_initial
    OF emp@other_db o
    JOIN emp t ON o.emp_id = t.emp_id
    AND o.last_name! = t.last_name
    ) source
    WE (target.emp_id = source.emp_id
    WHEN MATCHED THEN UPDATE
    SET target.last_name = source.last_name
    target.first_name = source.first_name,
    target.middle_initial = source.middle_initial,
    ;
    {code}
    assuming that emp is unique, at least in other_db.

    It will work in Oracle 10 (and more). In Oracle 9, MERGER still requires a WHEN MATCHED clause, so add one if you must. No matter what he does; the subquery USE will only return matches.

    Published by: Frank Kulash, October 10, 2011 16:45

  • Status of the indicator in the catalog is not preserved when the photo is added to the collection

    Here's my workflow

    1 import photos

    2. click on «All the Photos»

    3. in library mode, examine each photo. For each, I press X to reject, for the flag, or to not do.

    4. always in "All Photos," I select groups of photos to create Collections, for example, 'Beach 2010-11 journey.' I understand not all photos of beach trip: those which are marked with a flag, those that are marked to reject, and those who are not marked not anyway.

    And here is my problem

    When I go to the newly created collection, no pictures are marked with white or black flag. All photos are present, but none have kept the status of the indicator. If I return to display 'All the Photos', the flags are still there, but they are not visible in the collection.

    I do not create virtual copies during collections.

    I use LR 3.2 on OS X 10.6.5.

    Any help is appreciated!

    This is the way Lightroom works... has always. Flag State is local to the folder or the collection in which it is defined. It shows that in this collection or folder. In fact, you might have the same photo in a collection and rejected in another and neither in the photo folder.

    HAL

  • Flash does not work when the screens are deployed

    I use the latest version of Flash CC and now when I try to draw using my tablet in flash it causes traces from brush hang the canvas, it only works if I duplicate screens. How can I fix it?

    He is a current and documented issue that flash continues to have. I do not remember the answer (if found), but I suggest you do a search in the forums here, the question at least once a week.

  • No sound from speaker, but sound does not return when the headphones are connected

    I have an Acer ASpire V3 - 572G
    When I unplugged my headphones don't switch on my speakers. When I reconnected my headphone the sound returned ony through the headphones.

    Things Ive tried
    Checked in the playback devices to see if the speakers have been checked as audio by default
    Reinstalled and updated my Realtek Audio drivers.

    Was finally able to get the sound back to my speakers. Seems it was my audio jack, sensing that something was plugged when none existed.

    I'm a Manager DD Realtek Audio and messed with the retasking speaker options. With the help of user help? "s solution and audio in my speakers briefly returned." Then went away.

    So I turned off my laptop has had little compressed air and a toothpick and went slightly on the edges of the socket. Transformed sound and return on return.

  • You can control when the styles are added on your style sheet?

    I would like to have css files organized in a certain way for the ease of use and DW sometimes join the end and sometimes add to the middle.

    It is quite easy to organize styles in CSS designer. There are several aspects:

    • When a selector is already selected in the pane of selectors, by clicking on the button "+" to create a new selector inserts the new rule of style immediately after the selected one.
    • If you want to move the selectors in your stylesheet, you can drag and drop them in the Panel of selectors. The style rules will be moved to the new location in the style sheet.
    • You can even move a different style sheet style rules. Select the styles that you want to move and begin to drag. Keep the mouse button while dragging on the @Media pane and then drag the style selected on the stylesheet to target in the Sources pane.
    • To adapt a style rule existing for use in a media query, right click on the selector and choose duplicate in the query on the shortcut menu. You can then select the media query in the submenu that appears.
  • Photos do not sort by time when the Date and time are adjusted

    I'm the combination of images of my friends with those friends, using Mac Photo of OS X V10.11.4. Because the dates of our cameras vary, I used "Image, set Date and time" to change the dates of the imported pictures. When the dates and times are adjusted, the photos are sorted by date no time. Added photos changed the given date are sorted at the end, regardless of time stamp. The sort options in the pictures leave much to be desired.

    Where are you seeing this? All the photos are sorted by date/time, the photo has been added to the library - Photos (years/collections/moments) are sorted by date/time pictures

    You can select the photos of interest and create your own album of them and then sort but title ascending or descending or by date

    LN

  • When I sort the bookmarks in "organize bookmarks" they are not sorted under the bookmarks dropdown. Latest additions are not integrated in the genre

    When I sort the bookmarks in "Organize bookmarks" they are not sorted in the menu deroulant on a standard page. Recently added favorites are not included in the sort.

    See this:
    https://support.Mozilla.com/en-us/KB/sorting+bookmarks#Sorting_by_name

  • Data from the field drop-down list does not clear when the reset button is activated

    Acrobat Pro XI

    All field boxes are checked in the tab properties of the button actions... but when I click on the reset button of the form I created only the data in clear text fields, not any of the data that has been selected in a drop-down list.  What I am doing wrong?

    The 'rest shape' command returns the fields to their default values. If this

    value is not empty, that's what he'll be back.

Maybe you are looking for

  • XPRT: Adding a new contact add contact to ALL my accounts

    I just changed the XPRT so I hope that this issue is something that I just do bad. When I add a new contact on the phone, the contact is added to all my accounts (in this case 7 accounts), and each of them appears as a contact with 7 links. I don't s

  • channel search

    Hello I'm programming an application in LV7.0.  The app is an extension of a previous application, and I need to find where strings are used throughout the program.  How do you search for a string in a vi and all sub vi, for a given application? Than

  • HP ENVY 5530: HP ENVY 5530 in offline mode

    Hello I had my HP ENVY 5530 for about 6 months, and since the beginning, whenever I print something, I would say that my printer is offline, so I have to restart the printer to print something. The printer works fine with my iPad and my S4 galaxy. In

  • Photosmart 7520e all-in-one pr: 7520e all in one photosmart printer problems

    I just performed a cover of the plant on my windows 7 64 bit desktop, HP Pavilion Elite HPE150F, now I have problems with my printer, I share wireless with my windows 7 and 8.1 HP Envy 700 019-office windows, desktop computers are wired and my office

  • LIte on USB WiFi adapter 802.11 b/g

    The foregoing not lodged in my HP Pavilion s5320, but I'm unable to establish a stable wireless with a new Superhub provided by Virgin Media. This hub is N Wireless and it was suggested by VM that this adapter is not suitable with Microsoft virtual M