Highlight on ListView

Hello

I want to highlight selected items in listview with attached ListItemComponent.

My current version of the SDK is 10.1 and I tried to use the highlightAppearance function, but it does not work.

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

My code looks like:

{To ListView
ID: autreliste
objectName: "autreliste."
dataModel: ficheprogramme.getOtherPrograms
onDataModelChanged: {}
If (otherList.dataModel.childCount (1)! = 0)
{
autresEmissionsLabel.visible = true;
}
}
listItemComponents:]
                            
{ListItemComponent}
type: "header.
{To header
visible: false
}
},
                            
{ListItemComponent}
type: 'point '.
                                
{Of container
                 
{Of container

layout {}
{DockLayout}
                                            
}
}

{Label
text: ListItemData.date_diffusion
textStyle {}
fontSize: FontSize.PointValue
fontSizeValue: 8
fontWeight: FontWeight.W400
color: Color.White
}
}
                                        
}
}
                                
------------------------------------------
                            
I had once result (a blue box around the selection on tap) by setting the "ListItemData" as a type of ListItemComponent. The solution was not good because I wasn't able to customize the color of the text, size, container pads... the items in the list.

Thank you for your help,

Samantha

Thanks to all for your responses!

I finally did it with this solution:

{ListItemComponent}
type: 'point '.
{Of container
                                  
attachedObjects:]
{ImagePaintDefinition}
ID: border
imageSource: "asset:///images/frame.png."
}
]

background: ListItem.selected | ListItem.active? border.imagePaint Color.Transparent

I applied as a background of a picture transparent of an image that I made with Photoshop. It's a bit trickier, but it works.

Tags: BlackBerry Developers

Similar Questions

  • How do I set the background / highlight on the listView when select multi use

    Hi, I'm used to select multi on the list view, the problem is when the selected item does not change the background (I think by default will change in light blue)

    Maybe because I'm not using StandardListItem on itemList, I use clean container for itemList.

    How to set the color to the element highlighted on multi select listView?

    Thank you

    I use the background property on my customized itemList:

    {Of container

    ID: listItemContainer

    background: listItemContainer.ListItem.selected? Color.Create("#18AFE2"): Color.create("#018AFE2")

    ...

    }

  • Highlight the item selected in the ListView

    Hello guys,.
    I have a list view and you want to highlight the element select when I click on it, for all clicked items.

    Thank you.

    esam_tec wrote:

    Hello guys,.
    I have a list view and you want to highlight the element select when I click on it, for all clicked items.

    Thank you.

    There are different ways to do

    eg.:

    in your container of ListItem:

    background: ListItem.selected || ListItem.active ? Color.Magenta : Color.Transparent
    

    in your onTriggered of the ListView:

    // select line
                    myListView.select(indexPath, true)
    

    Remember, if your work has been done:

    // clear the selection
                myListView.clearSelection()
    
  • Change the background color for a selected item in a ListView?

    Hello

    No idea how to change the color of tbackground of a ListView selected item to blue for a different color?

    I tried wrapping the ListView in a container, then by changing the background color of the container, but it does not work. And ListView, nor the ListItemComponent takes a background attribute.

    Thank you

    Oh, I did that last night.
    Thus, in the container for StandardItem, add this line:

     background: ListItem.selected || ListItem.active ? Color.create("#4D9EC9") : Color.Transparent
    

    and onTriggerred of the signal, add two lines:

    // for highlighting
    listView.select(indexPath, true);
    
    // for clearing highlight
    listView.clearSelection();
    

    PS: listView is the id of the ListView

    ListView {
        id: listView
    ....
    
  • ListView - multiple selection works only for StandardListItem

    Hello

    In the meantime, this ListView object are less contraingnant to use; I modified my UI to work as an example of application of Battambang.

    But I have another question

    I use a GridListLayout (such as sample app stamp collector) and my ListItem is a container custom instead of StandardListItem.

    Unfortunately multiselect Manager works only with StandardListItem

    In my case, the context menu is empty!

    RIM is able to provide a sample of collector of stamps with GridListLayout? and multi select Manager / work context menu? and to highlight the points of stamps feature works in multi selection mode?

    Nicolas

    Indeed, the DeleteActionItem is not visible all in Multi Mode. I also tested is not serious if it is set with GridListLayout or not and even deleteAction.enabled of adjustment.

    I have raised a question of public affairs to do this, https://www.blackberry.com/jira/browse/BBTEN-173 so, please vote for it when you get a chance.

    See you soon,.

  • How to Configure ListView-> ListItemComponent-> the opactiy of the container to 0.0?

    Hi all

    How do you RESET ListView opacity to 0.0?

    I have a ListView with 5 elements.

    I want to adjust the opacity on the selected element.

    For example: -.

    When I click on item # 1, opacity will increase from 0.0 to 0.5.

    And when I clicked on the point n ° 2, the list will be reset (medium opacity of the n ° 1 0,0) and change the opacity of 0.0 to 0.5

    Here is my fault codes, and it does not work.

    function setDestinationHighlight (highlighted) {}

    If (highlighted) {highlightContainerDestinationList.opacity = 0.5 ;}

    else {highlightContainerDestination.opacity = 0.0 ;}
    }

    Connect the onActivedChanged signal to the highlight function
    ListItem.onActivationChanged: {}

    clearSelection();
    setDestinationHighlight (ListItem.active);
    }

    Connect the onSelectedChanged signal to the highlight function
    ListItem.onSelectionChanged: {}

    clearSelection();
    setDestinationHighlight (ListItem.selected);
    }

    Thank you.

    Found the methods.

    1 added a container (id: highlightContainerDestination) on top another container (id: displayUI - description, images).

    2. Add the clearSelection(); and select(indexPath,true); function onTriggered as below:

    function setDestinationHighlight (highlighted) {}

    If (highlighted) {highlightContainerDestinationList.opacity = 0.5 ;}

    else {highlightContainerDestination.opacity = 0.0 ;}
    }

    Connect the onActivedChanged signal to the highlight function
    ListItem.onActivationChanged: {}

    setDestinationHighlight (ListItem.active);
    }

    Connect the onSelectedChanged signal to the highlight function
    ListItem.onSelectionChanged: {}

    clearSelection();
    setDestinationHighlight (ListItem.selected);
    }

    onTriggered: {}
    clearSelection();
    Select (row);

    }

  • Border of element listview

    I was wondering how do you add border of ListView items?

    Also, is it possible to change the background of the listview item to choose?

    The following code example illustrates adding a container that will simulate a border and highlighting the container for the background of the list item selected.

        content: Container {
            layout: DockLayout {
            }
            ListView {
                property variant nIndex
                id: listView
                objectName: "listView"
                horizontalAlignment: HorizontalAlignment.Center
                dataModel: MyListModel {
                    id: myListModel
                }
                listItemComponents: [
                    ListItemComponent {
                        Container {
                            layout: DockLayout {
                            }
                            preferredWidth: 768
                            preferredHeight: 70
                            background: Color.create("#000000")
                            Container {
                                layout: DockLayout {
                                }
                                preferredWidth: 768
                                preferredHeight: 60
                                background: Color.create("#ffffff")
                                id: highlightContainer
                                Label {
                                    text: ListItemData.text
                                }
                            }
                            ListItem.onSelectionChanged: {
                                if (selected) {
                                    highlightContainer.background = Color.create("#75b5d3");
                                } else {
                                    highlightContainer.background = Color.create("#ffffff");
                                }
                            }
                        }
                    }
                ]
                onTriggered: {
                    listView.select(indexPath, true);
                    listView.select(nIndex, false);
                    nIndex = indexPath;
                }
            }
        }
    

    The QmlListViewAttached object is what provides the ListItem property:

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__QmlListViewAttached.html

  • Conditional highlighting with checkbox in the two cells by the numbers

    I have two columns.

    Check boxes, the other contains text.

    I want to apply formatting conditional for text, based on the checkbox (true/false) value.

    Hi Bebaj,

    Add another column (C in this example). You can hide C when everything works.

    Formula in C2 (fill down)

    = IF(A2,B2,"")

    A tick in a check box inserts the value of B in C, another "" (NULL)

    Conditional highlighting in column B

    Kind regards

    Ian.

  • Pages 5.6.2, cannot highlight and change the color of the text?

    I use pages 4.3 and earlier of passage to 5.6.2 - I just tried to highlight a word in a document and change the color - nothing happened.  Tried selecting the color first, and then type a new Word and that doesn't work either.  Am I missing something?  Is there any quick way to the color of the text in 5.6.2?

    To well highlight a word or a selection of words in the v5.6.2, Pages you will need to select the text, click the image below on the gear watch icon and set the fill color of your character. To remove the highlight, select your text, click in the ink of fill color of characters and click transparency icon in the lower right.

  • Cannot change the incoming mail server. no text highlight

    I am unable to send mail from my Mac.  No problem with iphone or iPad. Cannot change incoming mail server as text is not highlighted.  Cannot change the server for outgoing (SMTP) mail. Cannot change the list of SMTP servers. Says offline.

    Hi Granny Smith 1.

    Thank you for using communities Support from Apple. Sorry to hear that you are having problems with mail. It's a little bit clear exactly what you see when you say that you cannot change any server info, but if you continue to have problems sending or receiving mail, you will find the troubleshooting steps in the following article useful:

    If you cannot send or receive e-mail on your Mac - Apple Support

    Kind regards.

  • Highlighted in yellow, a section of a message cannot find how to do this.

    I received messages where the highlights of person in yellow a phrase or section of my message they respond to-please, how to do this?

    Messages on the Mac does not support rich text (e.g. highlighting, pointed out, etc) creation (even with copy/paste styles). Someone using Thunderbird, or MS Outlook client e-mail you can send messages with yellow text highlighting, because Apple Mail includes in HTML background colors. Apple Mail has no native user controls to apply a (lasting) nail on the compound, or responded by e-mail.

    You can compose your response by email in TextEdit, apply the highlight yellow, crossed and other features, you can then export of Rich Text in an HTML document. You double-click on it, and it will open in Safari. You then copy/paste the content of Safari read in the body of your Apple Mail compose window. Most will not want to do that, because it's just annoying.

    Successfully, I sent and received the original e-mail, including the (invisible) HTML markup, including the yellow background, in Apple Mail. Your mileage may vary depending on the features of the agent from the user for the mail to the recipient.

  • Preview highlight Sierra

    Did someone else having the same problem where once I pointed out and move to the next page and returning to the previous page highlight, automatically double highlight making the darker highlight?

    If you mean this...

    Yes.

  • Sierra of MacOS: How to highlight the text messaging?

    Mail to Sierra has the ability to use the highlight text? If so, how exactly is supposed to use it?

    With earlier versions such as Yosemite, there was a procedure mombo jumbo to create a copy highlighted in TextEdit text, save it in Styles and then use it in Mail. However, this old procedure no longer in Sierra. This procedure, however it seems a childish and surprised procedure than Apple people do not take care of this in later versions and not in the Sierra.

    Given that the feature "highlight text" is missing in the Sierra (the most advanced OS on the planet, some say, really?) I tried to do the same as previous in the Yosemite, has created a highlight in TextEdit text style, but cannot be used in the email. The context menu is different, does not allow to select 'styles '. If you go to Menu/Format/Style option "Styles" is grayed out!

    See this post. Re: Re: highlight text and delete in Mail

    I have not tried in Sierra.

  • BIOS, 10, Mr President, will not, read, highlighted, texts

    I have updated to iOS 10 but theres no

    highlighted longer option for Siri read the texts.

    Hi Marybanana,

    Thank you for using communities of Apple Support. Based on what you said, it seems you want Siri to read what you have highlighted using iOS 10.

    If you go to settings > general > accessibility > speech > enable selection of talk and an option to highlight the content will appear for you to. There you can select words and or phrases to highlight.

    See you soon

  • How to highlight the minimum value in a column?

    I need to highlight the lowest value in each column in my spreadsheet. I try to use the conditional nail, but I can't find a function to work as I need.

    One way would be to calculate the minutes in a cell of a footer row, select the cells in the body of the column and apply conditional highlighting like this:

    You must click on the chip address first, and then select the comparison cell, A8 here, then be sure to keep the row and column.

    The A8 from the example formula is = MIN (A).

    The result is a bold 2 (not shown in the screenshots).

    SG

Maybe you are looking for