Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 107
Registered: ‎05-11-2011
My Device: BlackBerry Z10 LE
My Carrier: AirTel

Re: How to displat this XML in List View QML

Hi,

 

You did not privide xml file . any way i have solution, hope it is useful for you.

 

Replace your code.

 

  listItemComponents: [      
                             ListItemComponent {
                                 type: "Venue"
                                 VenueManagerList {
                                 }
                             }
                         ]

 

With

 

       listItemComponents: [
                ListItemComponent {
                    type: "item"
                    StandardListItem {
                        title: ListItemData.name
                        description: ListItemData.Distance
                    }
                }
            ]

 

it's a standardlistitem . if you want add more field  you can customize your own row.

 

https://developer.blackberry.com/cascades/documentation/ui/lists/list_view.html

 

 

Developer
Posts: 202
Registered: ‎04-19-2011
My Device: Blackberry Bold 9780
My Carrier: TAM

Re: How to displat this XML in List View QML

Thank you for the reply.

Maybe you haven't read this topic from the start. So, i will explain more about my coding here.

I have already describe my xml in my first post of this thread

<root>
  <Venue>
    <IdVenue>501</IdVenue>
    <Name>guan sheng di jin miao. kelengteng guang gong</Name>
    <IdCategory>122</IdCategory>
    <Address>jalan martadinata</Address>
    <City>Tuban</City>
    <Latitude>-6.8908800000000001</Latitude>
    <Longitude>112.0459175</Longitude>
    <Distance>13091</Distance>
    <UserLike>False</UserLike>
    <CommentCount>0</CommentCount>
    <LikeCount>0</LikeCount>
  </Venue>
  <Venue>
    <IdVenue>1757</IdVenue>
    <Name>Galang's Mansion</Name>
    <IdCategory>41</IdCategory>
    <Address>Jalan Basuki Rahmad Nomor 99</Address>
    <City>Tulungagung</City>
    <Latitude>-7.1284299999999998</Latitude>
    <Longitude>112.11834</Longitude>
    <Distance>19305</Distance>
    <UserLike>False</UserLike>
    <CommentCount>0</CommentCount>
    <LikeCount>0</LikeCount>
  </Venue>\
</root>

 And i saved it to local directory of asset

../app/native/assets/resource/xml/venueTag.xml

And VenueManagerList is an custom component QML that i created. You can see in my VenueManagerList.qml, there is ListItemData that i've used.

Developer
Posts: 202
Registered: ‎04-19-2011
My Device: Blackberry Bold 9780
My Carrier: TAM

Re: How to displat this XML in List View QML

[ Edited ]

Ok, i've figured it myself..

I miss my listItemComponent type.

When i change it from Venue to item, it works like a charm..

Thank you for all of your ideas & sunggestion.

Really appreciate it.

 

and sorry for raj_jyani, i didnt see the item type. Thank you for your solution.