Custom list item changes when you click

I'm having a strange problem.

When my list of messages is filled first, she checks a property in the json data to see if the message is 'read' or 'unread '. If it is "no read", it will be a different color than those who are already "read" to indicate to the user.

It works very well, however I added an action context to the list, and when this action is triggered, I'm changing the message "unread". If the color of the list item to change. This works.

However, after I changed the color of a single item in the listwhen I do scroll down and down, many elements change color. I think it has to do with the rendering of the list of recycling.

This behavior does not occur after that list first initializes. Regardless of the colors have been queued to initialize their place. Only after that I have an amendment to one of the elements in the list, things go crazy when I scroll. I hope I'm being clear.

How can I stop this from happening?  This is the code that changes the color of the label in my custom list item.

 listItemComponents: [
                            ListItemComponent {
                                MessageListItem {
                                    id: messagesListItem
                                    contextActions: ActionSet {
                                        ActionItem {
                                            title: "Mark Unread"
                                            onTriggered: {
                                                if (messagesListItem.isNew == false) {
                                                    var selectedItem = ListItemData;
                                                    messagesListItem.isNew = true; //property of list item is changed to unread
                                                }
                                            }
                                        }
                                    }

And inside the MessageListItem.qml

property bool isNew: ListItemData.data.new

   onIsNewChanged: {
        if (isNew == true) {
            subjectLabel.textStyle.color = Color.create("#FF4500");
        } else {
            subjectLabel.textStyle.color = Color.create("#000000");
        }
    }

Please let me know if you have any questions, any help or suggestion is appreciated. Thank you!

Hello!

I think that it doesn't because you are not changing 'new' dataModel element variable. In addition, assigning directly control isNew breaks property DataModel is bound to it.

It should work if you change the dataModel instead.

An important point to note, however, that it is not possible to change the individual variables of dataModel point. You need to replace the entire item. The code example for GroupDataModel: (not tested, so may require tweaks, tell me please if you need help in getting this work):

onTriggered: {
  var selectedItem = ListItemData  // get a copy of dataModel's item
  selectedItem.new = !selectedItem.new  // modify it's property
  messagesListItem.ListItem.view.dataModel.updateItem(indexPath, selectedItem) // update the model
}

For ArrayDataModel, the function is named differently.

In addition, this line seems suspicious:

property bool isNew: ListItemData.data.new

Probably, it should be replaced by this one:

property bool isNew: ListItemData.new

Tags: BlackBerry Developers

Similar Questions

  • Result has changed when you click on the PDF attachments

    Result has changed when you click on the PDF attachments.

    It's recent, possibly after updates, I use Adobe Reader 10.0.10, Firefox 35.0.1 on a computer that is running Windows 7

    I no longer get the open/save dialog box when I click a pdf attachment, how do I get that back please?

    I have other problems, but they may be related to the above, so I would like to sort first if possible.

    ,

    In Firefox, go to Tools - Options - Applications and enter "pdf" in the filter field. Then select the action you want from the list.

  • want to turn off highlight the particular list field line, when you click

    Hello

    I have a list of line 3 display, on which I have 2 lines that are highlighted with little color.

    When I click on the particular line, I want to turn off the highlight on this line.

    How can I remove the list and add to the list to turn off highlight the special line, which is which is clicked by the user.

    Concerning

    Antoine Singh

    Hello

    I was able to do

    I have again to call the constructor of the list view by changing the value in the table highlight

    Concerning

    Antoine Singh

  • image and text change when you click sublink

    Dear Sir

    I would like to know how I can show a picture when I clicked sublink?

    I have 3 MCs: sub_bg, ImgMc and bg.

    sub_bg of the code is:

    function linkF(s:String):Void

    {

    _root. S = BG.txt.htmlText;

    }

    BG of the code is:

    Stop();

    var styles = new TextField.StyleSheet ();

    styles. Load("CSS/main.css");

    _root. BG.txt.html = true;

    _root. BG.txt.StyleSheet = styles;

    _root.sub_bg.subTXT.html = true;

    _root.sub_bg.subTXT.stylesheet = styles;

    var newsXML:XML = new XML();

    newsXML.ignoreWhite = true;

    newsXML.onLoad = {function (success)}

    If (success) {}

    var defaultp:String = newsXML.childNodes [0] Sublst.ChildNodes(1).ChildNodes(0) [1] Sublst.ChildNodes(1).ChildNodes(0) [0].firstChild.nodeValue;

    _root. BG.txt.Text = defaultp;

    for (var i: Number = 0; i < newsXML.firstChild.childNodes [1].childNodes.length; i ++) {}

    var tlink:String = newsXML.childNodes [0] Sublst.ChildNodes(1).ChildNodes(0) [1] .attributes. Name;

    var links: String = newsXML.childNodes [0] Sublst.ChildNodes(1).ChildNodes(0) [1] Sublst.ChildNodes(1).ChildNodes(0) [i].attributes.name;

    imageS of the var: String = newsXML.childNodes [0] Sublst.ChildNodes(1).ChildNodes(0) [1] Sublst.ChildNodes(1).ChildNodes(0) [i] .attributes. ImgUrl;

    The var text: String = newsXML.childNodes [0] Sublst.ChildNodes(1).ChildNodes(0) [1] Sublst.ChildNodes(1).ChildNodes(0) [i] Sublst.ChildNodes(1).ChildNodes(0);

    _root.sub_bg.subTXT.htmlText += ' < a href = "asfunction:linkF," + text + "" > "+ links + '< /a > < br / >';".

    _root.sub_bg. LinkTitle.htmlText = tlink;

    }

    }

    }

    newsXML.load("xml/homes.xml");

    I'd appreciate your help.

    Kind regards

    MELAS

    Post edited by: melas076

    use:

    function linkF(s:String,s2:String):Void

    {

    _root. S = BG.txt.htmlText;

    _root. ImgMC.loadMovie(s2');

    }

    Stop();

    var styles = new TextField.StyleSheet ();

    styles. Load("CSS/main.css");

    _root. BG.txt.html = true;

    _root. BG.txt.StyleSheet = styles;

    _root.sub_bg.subTXT.html = true;

    _root.sub_bg.subTXT.stylesheet = styles;

    var newsXML:XML = new XML();

    newsXML.ignoreWhite = true;

    newsXML.onLoad = {function (success)}

    If (success) {}

    var defaultp:String = newsXML.childNodes [0] Sublst.ChildNodes(1).ChildNodes(0) [1] Sublst.ChildNodes(1).ChildNodes(0) [0].firstChild.nodeValu e;

    _root. BG.txt.Text = defaultp;

    for (var i: Number = 0; i<>

    var tlink:String = newsXML.childNodes [0] Sublst.ChildNodes(1).ChildNodes(0) [1] .attributes. Name;

    var links: String = newsXML.childNodes [0] Sublst.ChildNodes(1).ChildNodes(0) [1] Sublst.ChildNodes(1).ChildNodes(0) [i].attributes.name;

    imageS of the var: String = newsXML.childNodes [0] Sublst.ChildNodes(1).ChildNodes(0) [1] Sublst.ChildNodes(1).ChildNodes(0) [i] .attributes. ImgUrl;

    The var text: String = newsXML.childNodes [0] Sublst.ChildNodes(1).ChildNodes(0) [1] Sublst.ChildNodes(1).ChildNodes(0) [i] Sublst.ChildNodes(1).ChildNodes(0);

    _root.sub_bg.subTXT.htmlText += "" + links + " ."
    ";

    _root.sub_bg. LinkTitle.htmlText = tlink;

    }

    }

    }

    newsXML.load("xml/homes.xml");

  • Text changes when you click with the text tool before editing

    I have a big file and think that there not saved properly or something. I tried quiting and relaunch Photoshop, but this does not help. Editing the text of other Photoshop files normally works.

    As soon as I click on any text with the text tool, as if I'm going to change or style of the text, the text changes instantly. The content and style of the text shall be replaced as soon as the cursor is placed anywhere in the string.

    The really weird thing is the updated text is text that appears elsewhere on the page. If I click on another text that she is now to who will also get automatically replaced by another text on the page. And it goes on and on. It is impossible to edit or any text style unless I have create a new text.

    I think that the file has arranged miss references to items that becomes apparent that I am editing.

    A way to fix this?

    Out of curiosity, do you have a Mac or a PC, Dan?

    And no, there is no known solution for the corruption in the PSD.

    -Christmas

  • Photo not added to the quick Collection when you click marker

    Recently I have not been able to add photos to a quick collection, when you click on the marker. The marker provides information, but the photo does not appear in the quick collection. This problem occurred at the same time, I couldn't remove the photos in the quick collection that had been added. I had to remove these photos using the menu system. I've upgraded to the new version of Lightroom 5 yesterday thinking that would solve the problem. I still have the problem so I wonder if this is a setting that I missed. Quick collection markers button is enabled in the display options and the button and change when you click them... The thumbnail of the photo is not added to the quick collection.

    It seems that you no longer have the quick Collection, referred to as a collection of target. Is there a small symbol '+' next to the name of the collection? If this isn't the case, you have another collection in your designated collection list.

    To fix, right-click the name of the quick Collection and click the option "set as target Collection.

  • the page is rendered and loaded questions of list item change

    Hi all

    I have 2 questions, I'll try to put it as clear as possible. The link and log in info on the bottom.

    1. in what order is the rendered page fire? In other words, I have a report to Page 2 (Payroll Summary) and in this report, I select and where clause. The where the info from the article comes from a list item. When you view the report it shows nothing, so I guess that because the element is not filled in and yet, this is why the report does not. Not sure... so if someone can clarify that for me, it would be great.

    2. when I change a list item (eg. Payroll between 2010 and 2009 year), how can I refresh the payoll report that uses the year of payroll as a parameter? is it possible to launch the summary report on the Payroll when the year changes? If so, how?

    My apex page is

    http://Apex.Oracle.com/pls/Apex/f?p=31754:2:678019909905630:no:

    It is application of dashboard.

    Workspace Laba
    Username [email protected]
    Password edumet

    Once the connection to the application info is

    E-mail [email protected]
    password Laba

    Thank you
    Laba

    Emeric,

    When the page is sent after the selection value is changed, the prior to execution of the header calculations. I added a condition on the calculation, so that it only works when the value of the element is set to zero.

    Thank you
    Machaan

  • Drop-down list box will not drop down when you click on

    I have three area of list editable dropdown menu instances in a form and they are all filled with the data in a table. The problem is none of them the menu is displayed when you click the arrow. They also have a problem of tabbing through them. I can see all the data by selecting from the drop-down list boxes by using the arrow keys, but I need to get the drop-down menu work.

    Thank you!

    If found the problem... Since I handle items in combo box list dynamically in the context of a movieclip I had to set "my_formMovie._lockroot = true;". This corrects the problem.

  • My Windows Media Player does not open upward when you click it in the list of available programs, nor will any media over the internet using Windows Media does not work

    My Windows Media does not open upward, when you click on Window Media Player in the list of available programs nor play any internet media using the Media window. I have the 110.6002.18311 version. Any help to fix this problem will be appreciated.

    Hello

    You can try to re register the dll files for windows media player and if it helps fix your problem. To do this, please follow the steps below:
    1. Click Start, type cmd in the search box and right-click on cmd.exe, and then click Run as administrator.
    2. At the command prompt, type the following commands and press ENTER after each command:
    regsvr32 vbscript.dll
    regsvr32 jscript.dll
    regsvr32 wmp.dll
  • Change the window when you click on checkbox.

    InDesign 3 (5.0)

    ScriptUI (Javascript) in the XP box.

    Try to get a window to show more control when you click on a checkbox and then hiding when it is not checked.

    I tried to create the additional controls to create and then hide them, but this is not of course redraw the window. I'd rather have the window redraw and the layout manager control the position of controls, because they are added or removed. Then I did not empty in my window spaces when the additional controls are not displayed.

    #target "inDesign - 5.0;

    #targetengine "session."

    main();

    main() {} function

    var myWindow is new window ('pallet', 'Signs');.

    myWindow.alignChildren = 'left ';

    buttonGroup var = myWindow.add ('group');

    var makeSignsButton = buttonGroup.add ('button', undefined, "Make signs");

    makeSignsButton.alignment = 'left ';

    var printGroup = myWindow.add ('panel', undefined, "Signs of impression");

    printGroup.orientation = "row";

    var advancedCheck = printGroup.add ('checkbox', undefined, "Advanced");

    allRadio var;

    var currWeekRadio;

    var nextWeekRadio;

    var printSignsButton = printGroup.add ('button', undefined, "Signs of impression");

    advancedCheck.onClick = function() {}

    If (advancedCheck.value == true) {}

    allRadio = printGroup.add ("radiobutton", undefined, "All");

    currWeekRadio = printGroup.add ("radiobutton", undefined, "Current of the week");

    nextWeekRadio = printGroup.add ("radiobutton", undefined, "Next week");

    }

    If (advancedCheck.value == false) {}

    printGroup.remove ("allRadio");

    printGroup.remove ("currWeekRadio");

    printGroup.remove ("nextWeekRadio");

    printGroup.remove ("advancedCheck");

    }

    } / / end "advancedCheck.onClick"

    makeSignsButton.onClick = function() {}

    var confirmWindow = confirm ("Do you want to make signs", "Confirm signs to");

    myWindow.close ();

    } / / end of makeSignsButton onClick event handler.

    printSignsButton.onClick = function() {}

    var printConfirm = confirm ("Do you want to print signs?", "Confirm print");

    If (printConfirm == false) {}

    return;

    }

    } / / end "printSigns" onClick callback

    myWindow.show ();

    } function //end 'hand '.

    Once you change the arrangement of windows, add myWindow.layout.layout (true)

    call the layout manager.

    Ariel

  • Change the color of the text to the previous button when you click on a button

    Hi all

    If I said 7 buttons, each with text that changes color on turnover by using 'Up' 'Over' and 'Down' of the keyframes in the timeline buttons.  Is there a simple way to get the text of the button changes color when you click on it, stay that way, and then back to the original color once one of the other 6 buttons are engaged?

    The only thing I can get to prepare code pages for each button that changes the color of every other button regardless of whether it was active.

    See the code example would help a lot!

    Thank you!

    use:

    var previouslyClickedBtn:MovieClip
    var buttonA:Array = [content_mc.work_btn, next button and the rest of your buttons];
    var targetA:Array = [work_mc, etc.];

    for (var i: uint = 0; i<>
    .Ivar Button [i] = i;
    buttonA [i] .addEventListener (MouseEvent.CLICK, clickF);
    buttonA [i] .addEventListener (MouseEvent.MOUSE_OVER, overF);
    buttonA [i] .addEventListener (MouseEvent.MOUSE_OVER, overF);
    }

    function workOver(e:MouseEvent):void {}
    e.currentTarget.gotoAndStop ("over");
    }

    function workClick(e:MouseEvent):void {}

    {if(previouslyClickedBtn!=null)}

    previouslyClickedBtn.gotoAndStop ("up");

    }

    e.currentTarget.gotoAndStop ("down");

    previouslyClickedBtn = e.currentTarget;

    targetA [e.currentTarget.ivar] .gotoAndPlay ("enter");
    }

    function workOut(e:MouseEvent):void {}
    content_mc.work_btn.gotoAndStop ("up");
    }

  • When you visit a particular site my user name is entered automatically when you click in the required area. I want to avoid this, how?

    This site requires a username to be filled in a specific area and in another box, you enter a series of numbers generated by a generator of numbers (so not a password - different series each time that you open a session).
    However I do not want my user name appears automatically in the first box. Trying to change that in the security settings (extra-options-security), there is a password section where you can choose any exceptions to the rule of the memory (if the box remember is marked). When clicking the exceptions button, the url of the site I'm talking about is not displayed, and it cannot be entered either, since you can't delete here.
    When you click on the option "saved passwords", nor the site, nor the username is listed. I think I've read all the help sections regarding usernames and passwords, but found no solution.
    How can I avoid this username (so only a user name - not the usename/password combination), appear in the box?

    Click on the box, hover over the drop-down menu with your mouse, if you select the word you want to delete, and then press the delete key. If Firefox fills automatically in forms of control

  • I have a new MacBook Pro 13 "." When you click on almost ANYTHING, I get a drop-down menu, rather than the simple task. This includes a link to closing a window, writing a message of openness. Whatever it is. I've updated to 10.11.2.

    I have a new MacBook Pro 13 "." When you click on almost ANYTHING, I get a drop-down menu, rather than the simple task. This includes a link to closing a window, writing a message of openness. Nothing, including the drafting of this issue. A screenshot is included. I've updated to 10.11.2.

    Thank you!

    Bill Koechling

    Is it possible that you accidentally tap the touchpad with 2 fingers?

    Try to go to the preferences system-> Trackpad-> point & click and disable the "Secondary click" item Or change one option other than water from the tap 2 fingers.

  • files do not open when you click on

    Today, I tried to open two .txt files by clicking on it. It's the same thing when I tried to open a .jpg photo.

    I tried to click the icon and I tried holding it down, double clicking, etc. I forgot what to do to open a file or something has changed on my Xoom. I would really appreciate ome entry to tell me what the problem is.

    What is the bug 3.2 on the selector app shows off the screen?

    When you click on a file to open it, and there is no default program to open it with, a list of possible programs are provided to allow you to choose which program to use.

    I have 3.2 there is a bug. The list is posted outside the Visual area of the screen. The rest of the screen is blurry and slightly grey.

    The solution is to activate the auto-rotation and change beween landscape/portrait. The list of possible programs then appears and you can select how to open the file.

  • When you click "Restart now" after Windows Update, the computer stops, does not restart

    When you click "Restart now" to a windows update... the computer cycle throughout the judgment... and not restart.

    * original title - problems with computer restart (ing) after the updates *.

    Hello

    1st thing to try is a restoration of the system in safe mode

    http://www.windowsvistauserguide.com/system_restore.htm

    Windows Vista

    Using the F8 method:

    1. Restart your computer.
    2. When the computer starts, you will see your computer hardware are listed. When you see this information begins to tap theF8 key repeatedly until you are presented with theBoot Options Advanced Windows Vista.
    3. Select the Safe Mode option with the arrow keys.
    4. Then press enter on your keyboard to start mode without failure of Vista.
    5. To start Windows, you'll be a typical logon screen. Connect to your computer and Vista goes into safe mode.
    6. Do whatever tasks you need and when you are done, reboot to return to normal mode.

    If that does not read this information

    the link below is how to download and get a vista disk startup repair, which you can start from the

    http://NeoSmart.net/blog/2008/Windows-Vista-recovery-disc-download/

    Here's how to use startup repair system restore command prompt, etc. to bleepingcomputers link below

    http://www.bleepingcomputer.com/tutorials/tutorial148.html

    to boot from the dvd drive to be able to you will see a way to get into the bios Setup at the bottom of the screen or command menu start

    It would be F2 or delete etc to enter the BIOS or F12 etc. for the start menu

    Change boot order it do dvd drive 1st in the boot order

    http://helpdeskgeek.com/how-to/change-boot-order-XP-Vista/

Maybe you are looking for

  • System hangs after update to thunderbird.

    Thunderbird did an automatic update. After that, whenever I try to run it, the system reboots.

  • synchronization picture confusion

    I returned from vacation and, of course, has taken a lot of pictures. I have pictures of iCloud enabled on my iPhone and iPad and the photos are synchronized on both devices. I also have pictures of iCloud enabled on my computer. My confusion is with

  • 15 - s108na: portable computer Compaq

    Hi I have updated BOFWindows 8 to 10 Windows and my computer laptop use you cam face login for security. Since the upgrade to Windows 10 the face cam login you stopped working so I can't access my lap top. I'm used to be able to get around this by en

  • Automatic updates from Microsoft

    I've now had for July's malicious software removal tool to move 6 times. Suggestions how to stop this please

  • I can't change my desktop to something other than the default BLUE in windows XP.

    I have always used one of my favorites under my desk, and who suddenly disappeared.  I can't change any image or the other widnows XP desktop options.  I can how ever to change the color of the desktop.