BB10: ListView problem background elements

Hi guys,.

I have a listview which elements have origins are different colors (see figure). Each element background color depends on a specific element of the element in the data model (say ListItemData.color).

But for some reaason, when I scroll to the bottom of the list and scroll to the top, the background changes color. I do not understand this weird behavior.

People you have an idea about what is happening on or at least how to solve?

Thank you!

Hi all

I solve it by doing this:

Label
{
    visible: false
    text: ListItemData.id

    onTextChange:
    {
        root.background = ListItemData.color;
    }
}

It's not elegant at all, but at least it works. The 'id' the ListItem is the only single member. So evertytime this invisible label text changes with the new id, it resets the background for that particular item.

It is a pity I have to use such a solution for this problem.

Thank you all!

Tags: BlackBerry Developers

Similar Questions

  • ListView problem: scrolling non-stop

    Hello friends,

    I get some problem with ListView in ScrollView ListView doesn't stop scrolling.

    I want to put some of the views (for example, Label, textArea Image) in the vertical stack layout container & add a list at the end of the container, so that all opinions can scrolls.

    But I get unexpected results that everything is ok, but my view of the list doesn't stop event of scrolls of the item in the scrolling list.

    If I add some other view as tab after ListView then it never reached.

    Can someone give me a solution for this.

    Thanks in advance

    I use the following code for QML

    import bb.cascades 1.0

    {Of container

    background: Color.Yellow
    maxHeight: 1000
    preferredHeight: 1000
    ScrollView {}
    maxHeight: 1000
    preferredHeight: 1000
    {Of container
    {Of container
    topPadding: 10
    leftPadding: 10
    rightPadding: 10

    {Of container
    layout: {StackLayout}
    direction: LayoutOrientation.LeftToRight
    }
    TextField {}
    hintText: qsTr ("toEmail/Mobile number Email/Mobile Number") "") "
    }
    ImageButton {}
    defaultImageSource: ' images/add.png.
    pressedImageSource: ' images/add_focus.png.
    verticalAlignment: VerticalAlignment.Center
    horizontalAlignment: P
    }
    }
    {Of container
    topMargin: 10
    layout: {StackLayout}
    direction: LayoutOrientation.LeftToRight
    }
    ImageView {}
    preferredWidth: 120
    preferredHeight: 90
    }
    TextArea {}
    maximumLength: 50
    hintText: "title."
    preferredHeight: 180
    }
    }
    background: Color.LightGray
    preferredHeight: 720
    }

    {To ListView
    dataModel: {ArrayDataModel}
    ID: contacts
    }
    }

    onCreationCompleted: {}
    contacts. Append ("ABAC");
    contacts. Append ("ABAC");
    contacts. Append ("ABAC");
    contacts. Append ("ABAC");
    contacts. Append ("ABAC");
    contacts. Append ("ABAC");
    contacts. Append ("ABAC");
    contacts. Append ("ABAC");
    contacts. Append ("ABAC");
    contacts. Append ("ABAC");
    }
    }
    }
    }

    As far as I know, using listview in scrollview will cause infinite scrolling. To resolve this issue, try to set the height of the listview. You can also try to set the height of the listview based on the number of records by using contacts.size ();

    It will be useful.

  • To reorder ListView problem

    Hello

    10.3, reorganize the listview items is now possible via the RearrangeHandler class (https://developer.blackberry.com/native/reference/cascades/bb__cascades__rearrangehandler.html)

    I noticed during the implementation of this class that rearranging works only when the elements below are trained upward. When the elements at the top of the page it is slipped down the list, none of the signals (started, completed, updated, abandoned) don't are not fired. The user interface changes automatically isn't.

    Both the sample application or my implementation does not work when the elements above are trained more far.

    Can a BlackBerry person take a look at this? Thanks in advance.

    I tested on the official bone on the passport and classic version.

    I tried this sample and I see the same behavior that you are.  I sent the question to our development team to resolve.

    10.3.1 signals are fired, but you can not yet move items down.

  • Prevention of ListView, select the element for multi select

    How do you keep a user to select specific items during a statement select multi. You can use the MultiSelectHandler to do?

    I have essentially two types of elements. Setting caching and QUERIES.  When the user performs a Multi Select on a cached item... I want only their selection to other cached items.  Even if the user is running a Multi Select statement on an item not cached... I want only their selection of other items not cached.

    Is anyway to do this?  Been Googling for half an hour and can't find that everything about this use case.

    Since I use an element of custom list, I went to this subject a little differently. My CustomListItem implements a ListItemListener. I've implemented the select method as such.

    void CustomStandardListItem::select(bool select) {
        bb::cascades::ListItemListener* lil = static_cast(m_sli);
        bb::cascades::ListView * view = qobject_cast(this->parent());
    
        if (view->multiSelectHandler()->isActive()) {
            bool isCached = view->property("isMultiSelectTypeCached").toBool();
    
            if (m_cachedImageView->isVisible() && isCached) { // is cached.. allow selection of other cached objects only
                lil->select(select);
            }
            else if (!m_cachedImageView->isVisible() && !isCached) { // is not cached.. allow selection other cached objects only
                lil->select(select);
            }
        }
        else {
            lil->select(select);
        }
    }
    

    The dynamic property 'isMultiSelectTypeCached' is just a bool on ListView value that gets defined the type of ListItemComponent. It could have just as well been the type of ListItemComponent.

  • ListView - problem DockLayout

    Here is my code

    import bb.cascades 1.2
    Page {
        Container {
               layout: DockLayout {}
    
                    Container {
                        verticalAlignment: VerticalAlignment.Top
                        horizontalAlignment: HorizontalAlignment.Fill
                        Button {
                            text: "1.button"
                            horizontalAlignment: HorizontalAlignment.Fill
    
                        }
                    }
    
                    Container {
                        verticalAlignment: VerticalAlignment.Center
    
                        ListView {
    
                            dataModel: XmlDataModel {
                                source: "asset:///currencies.xml"
                            }
                        }
    
                    }
    
                    Container {
                        verticalAlignment: VerticalAlignment.Bottom
                        horizontalAlignment: HorizontalAlignment.Fill
    
                      Button {
                          text: "2. button"
                          horizontalAlignment: HorizontalAlignment.Fill
    
                      }
                    }
    
        }
    }
    

    When I use a viev list in a layout of the dock it dosent fit properly.instead, it collides with the first container.

    should he not just after the first container since I updated the verticallayout Center for container parent of the listview.

    Thanks in advance.

    When using the dock layout object are added as layers and the order given in qml are important. Your code adds a listview on top of the first box. What is happening, is that you will not be able to capture the actions for this button and once filled, the listview will overlap graphically the key 1.

    Below is an approach valid at your intent:

    import bb.cascades 1.2
    
    Page {
        Container {
            layout: DockLayout {
            }
    
            Container {
                id: cont
                bottomPadding: 73
                verticalAlignment: VerticalAlignment.Top
                horizontalAlignment: HorizontalAlignment.Fill
                Button {
                    bottomMargin: 0
                    text: "1.button"
                    horizontalAlignment: HorizontalAlignment.Fill
                    onClicked: {
                        console.log("dsds");
                    }
                }
                Container {
                    //background: Color.Blue
                    ListView {
                        dataModel: XmlDataModel {
                            source: "asset:///currencies.xml"
                        }
                    }
                }
            }
    
            Container {
                verticalAlignment: VerticalAlignment.Bottom
                horizontalAlignment: HorizontalAlignment.Fill
    
                Button {
                    text: "2. button"
                    horizontalAlignment: HorizontalAlignment.Fill
                    onClicked: {
                        console.log("da asdsa");
                    }
                }
            }
        }
    }
    
  • Problem first elements

    I've added several elements in a video project.  I decided to delete the last item.  I can't delete the beginning of the video clip form.  When I preview the it, it stops at the first frame of the clip removed.

    Why is this happening?  I can solve this problem?

    Mary Lou

    Mary Lou

    Thanks for the follow-up.

    With regard to the trial of the 13 items first... all imports in it will have the watermark of Adobe as seen in the edit box monitor.

    1. you can't you get rid of this watermark Adobe from exports of the first 13 items test (either export to the file saved in the computer

    hard drive or burn to disc).

    2. you can get rid of the tattoo Adobe Premiere elements 13 trial of the project file (.prel). For this you need 13 items first purchased.

    a. open the project first elements 13 tryout file recorded in first 13... bought items then chronology Menu/delete rendered files... the Adobe watermark is based on this project.

    or

    b. open Premiere elements project file 13 tryout recorded in first 13 bought items... and then do nothing but continue the project. So we have

    found that just opening the project of tryout in the acquis automatically removes the watermark of Adobe.

    Determine which of the two that works for you.

    There is no guarantee that a project created in an earlier version can be opened in a later version. But you can try. But do this by using a copy of the project file of the previous version. Once the project from the previous file is changed in the second version, you can't go back and change the edited version project subsequent to the previous version.

    Please let us know if you're OK with the above information. If this isn't the case, please do not hesitate to ask questions and seek clarification.

    Thank you.

    RTA

  • Problem with elements 13

    When I try to open a video file with elements 13 or 13 first I get an error message saying Compress/decompress (codex) not installed.  How to solve this problem?

    The solution has been install quick time.  I'm able to import videos with no problem now. Thanks for responding.  Allen

  • Uninstall problem photoshop elements

    can someone help me uninstall the photoshop elements - I had a problem with this program after loading a DVD, the Organizer works but not the Publisher. However, to try to uninstall, I got the error 1306: a ProgramData.../Thumbdatabase.db3 file could not be uninstalled because another file has exclusive access - it seems that the file is opened in the editor? Can anyone help

    Restart the computer and see if that releases the lock. Otherwise run the Task Manager and terminate any task that has the word 'Éléments' in it.

    See you soon,.
    --
    Neale
    Insanity is hereditary, get you your children

    If this post or by post from another user solves the original problem, please mark as correct and/or useful messages accordingly. This helps other users with similar trouble getting answers to their questions more quickly. Thank you.

  • Problem Background Image

    Hello
    I'm using a custom theme in APEX 4.0 on Oracle 10 g. I'm trying to add a background image to a page, and I find that the theme does not appear the image correctly. I need to click on the background image view to see the actual image...

    I know there is a way through css to override the existing background image/color, but today I simply didn't see / get it...

    Can anyone offer a suggestion?

    URL: http://enciva3.com/apex/f?p=132:1:1127045783946322 (page rough to demonstrate the point).

    Thank you

    Tony Miller
    Webster, TX

    Tony

    The background properties are applied to the body according to your stylesheet incorporated. The problem is that the body is invisible behind all this fancy theme UI widgets dan.

    Various s divon the page have styles online specifying absolute positions and z-index values that display them in front of the body of the page and have the .ui-pane-layout class that specifies the gray background. Override this rule with:

    .ui-layout-pane {
      background-color: transparent;
    }
    

    and the body with your background image becomes visible.

    On the other hand, put the background image on the main content div can be closer to what you're trying to achieve? Replace the body selector in your existing rule by div #delta - content of the page:

    div#delta-page-content {
      background-image: url(wwv_flow_file_mgr.get_file?p_security_group_id=9023722216290979&p_fname=ata_background.png) !important;
      background-repeat: no-repeat !important;
      background-attachment: fixed !important;
    }
    
  • BB10 Image problem

    I encountered a problem trying to update a qnx.fuse.ui.display.Image bitmapData:

    Here is my code:

    function update( bmp:Bitmap ):void{ var bmd:BitmapData = bmp.bitmapData;
    
        if ( bmd is BitmapData )
        {
            trace( _image.width, "x", _image.height, bmp.name, bmd.width, "x", bmd.height );
    
            _image.setImage( bmd );
            _image.visible = true;
    

    and here is the trace output:

    329 x 256 instance1872 341 x 256
    ArgumentError: Error #2015: Invalid BitmapData.
        at flash.display::BitmapData/get width()
        at qnx.fuse.ui.display::Image/getRawPreferredSize()[E:\hudson\workspace\BB10_0_09-AIR_SDK_API\src\qnxui\src\qnx\fuse\ui\display\Image.as:142]
        at qnx.fuse.ui.display::Image/setImage()[E:\hudson\workspace\BB10_0_09-AIR_SDK_API\src\qnxui\src\qnx\fuse\ui\display\Image.as:337]
    

    The new bitmapData seems to be ok, because the height and width are non-zero, so it seems to go to a previous instance of bitmapData (which has been replaced).

    I tried to keep a global reference to the old bitmapData, but same result...

    Suggestions please...

    to fix this, I added the following:

    if ( _image.bitmapData )
    {
        try
        {
            var testWidth:int = _image.bitmapData.width;
        }
        catch( e:Error )
        {
            var index:int = getChildIndex( _image );
    
            trace( "remove image at:", index, _image.x, _image.y, _image.hAlign, _image.vAlign );
    
            removeChildAt( index );
    
            _image = new Image();
            {
                _image.fixedAspectRatio = true;
            }
            addChildAt( _image, index );
    
            invalidateDisplayList();
        }
    }_image.setImage( bmd );
    

    ugly but necessary...

  • Display of images in a ListView problem

    Hello world

    I'm trying to display images in a grid (GridListLayout) in a ListView component (as in This example). However, it just displays the paths to the images I try to view (if it is not clear for you take a look at attachment 1). What I am doing wrong?

    In my data model, you can find this method of data:

    QVariant ComicsDataModel::data(const QVariantList& indexPath)
    {
        return QVariant("assets/images/legodude.jpg");
    //return coverList.at(indexPath[0].toInt());
    }
    

    The commented code returns the actual filepaths (absolute paths), but who doesn't either. Of course, I have included the image in the assets/images folder. The ListView is specified as written below.

                ListView {
                    objectName: "coverListView"
                    layout: GridListLayout {}
    
                    listItemComponents: [
                        ListItemComponent {
                            type: "image"
    
                            ImageView {
                                imageSource: ListItemData
                                scalingMethod: ScalingMethod.AspectFill
                            }
                        }
                    ]
                }
    

    Thanks for the help! All of the examples to work with images using XML as datamodel, I use a custom data model.

    Annex 1:

    Probably your datamodel custom does figure not correctly return the correct values in the DataModel::itemType() function - make sure you return 'image' properly in your overload of itemType() - or use the equivalent ListView callback function in QML

  • Problem background Eraser tool options

    How to unlock the option "do not erase the foreground swatch color" at the top of the bar when using the background Eraser tool.  None of my layer options are locked!

    You must have the preference of narrow bar of Options activate activated?

    In any case, click the icon to enable or disable.

    Off

    On

  • Start PROBLEM first element 14

    ERREUR.JPG

    Message with Windows 10 64 bit HOW SOLVE MY PROBLEM THANKS

    rouveauj

    Thank you for your response.

    Since you have the latest version of first items 14 and Chat online from Adobe offers support for this version, I encourage you to contact her to enjoy this ultimate expertise while you always have the option to do so.

    We will follow your progress everywhere where your son is as well regarding the response from Adobe.

    Best wishes

    RTA

  • 3-d problem/error element

    Hello

    I use item 3d v2.2 and after effects cs6, whenever I have applied a model or something extrusion I get this pressed down the version with the x-axis. Does anyone know a solution to this? Someone at - it else facing the same problem?element error.jpg

    Help please

    Thank you

    You do not work in a model of square pixels. You must either use a predefined model that uses square pixels or toggle button fixed pixel aspect ratio down your comp Panel.

  • How can I lock the background elements so that they don't move when I hit them

    I am new to Dreamweaver you will have to excuse my naivety.

    I create a design of e-mail in the firework which has a couple of background images (flags) - I can type on it using the background = code.

    But the image begins to repeat again if I enlarge the text. Is it possible to lock this image in place?

    I try to avoid using css I read that is not ideal for email too!

    Thanks for your help

    That's what the alt attribute of the image is for...

    What shows up if/when the image doesn't download goes here.

Maybe you are looking for

  • Deleted stream help photo album!

    I think I deleted my photo stream album.  How can I get it back?

  • Foxfire printing parts of pages when it should be one page.

    Foxfire page divided into several parts and printed several pages in small print. I am running Foxfire 5.0 but he did it with other versions. It seemed to happen suddenly months ago. I'm unable to solve the problem. I am running Windows XP Home Versi

  • Expansion card Thunderbolt for Mac Pro desktop

    Desktop Mac Pro with OS 10.11.3. I plan to replace my popular BU external hard drive with a 6 TB of Raid drive.  The office is not equipped with a Thunderbolt port and would therefore add an expansion card Thunderbolt.  Any suggestions? Having a larg

  • X 250 warranty repair turnaround...

    What is the typical turnaround for a covered warranty repair? My X 250 filing status indicates pending return card ordering system.

  • HP G62-355dx processor replacement?

    Hello I have a HP G62-355dx with windows 7, 64-bit and an AMD Athlon II Dual - Core P340 processor!, I would like to know if one can replace the processor with an AMD Turion 64 x 2 Dual - core T-60 processor 2 GHz? Thank you very much!!