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: 136
Registered: ‎02-01-2009
My Device: Not Specified

RSS feed - Text + images in list

Hi,

 

I'm playing with genreal RSS parsing and although the exmaple can be used as a starting point of downloading the XML and then loading it through an XMLDatamodel - to get the text, but in my case I want to dispaly a layout with both images and text some thing like

 

 

|         |  Text heading/title

| img |

|         | Text description

 

As the genric feeds, i get the textual information along with the URL of the image.

 

The QT version of Imageview do take the QUrl of an http image, but Cascades gives me error that isnt supported yet.

 

So, my questions are:

1. Is there a plan to have this feature implemented in the upcoming Sept- Release of the SDK

2. In case I have to implement it, then after my NetworkAccessManager downloads it, how do i send it back to the proper row where the lazy loaded image needs to be displayed?

---Any examples in this direction would be helpful.

 

Thanks!

 

Retired
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: RSS feed - Text + images in list

Hi there,

 

Have you looked at the Stamp Collector Sample Application? Also, are your images local?

 

Martin

 

Developer
Posts: 136
Registered: ‎02-01-2009
My Device: Not Specified

Re: RSS feed - Text + images in list

Yes, did had a quick look over the Stamp Collector example, and while it was all ok with the XML management, did shed much light with the dynamic data and images lazy loading ... please feel free to correct me if i overlooked anything with the example.

-- Images are not local -- the URL of images is from the server, and my main motive is to have them lazy load efficiently.

Like with XML, we need to reset the whole Data model for the list to refresh, but here, any image can come asynchronously and thus, i shouldn't be refreshing the whole list again and again.
Retired
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha
My Carrier: N/A

Re: RSS feed - Text + images in list

Great-

 

Your response was not clear to me if you still need assistance - Have you made any progress?

 

Martin

Developer
Posts: 136
Registered: ‎02-01-2009
My Device: Not Specified

Re: RSS feed - Text + images in list

[ Edited ]

-Removed, as got posted in response to incorrect thread

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: RSS feed - Text + images in list

Developer
Posts: 136
Registered: ‎02-01-2009
My Device: Not Specified

Re: RSS feed - Text + images in list

Apologies, the message got posted in the wrong thread.

Yes, i would still need help on this in contrast to the StampCollector example.

1. My images are not local and i only get their URL from the server, so , i can understand that I would need to download them locally and then use the local path to the list imageSource.
Or can it be done without explicit download of images from my code - list in QT - QImage taken QURL as an argument and then downloads it.

2. Once the images are downloaded, how would they be refreshed by the data model. Do i need to update the whole model or since i already know the file name before downloading - i can set it appropriately to the local path and once they are downloading, the QML will automatically load them?
Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: RSS feed - Text + images in list

Did you make any progress on this front?

 

A few things to consider:

  1. Read https://developer.blackberry.com/cascades/reference/bb__cascades__datamodel.html#itemadded, description of itemAdded, itemUpdated, itemRemoved, itemsChanged.
    This is the superclass for data models.
    So if the data model issues a very specific signal "itemChanged" then that item should get refreshed.
    However, if the data model issues the "too much changed" or "I can't really refine it" signal itemsChanged, then the whole list will be updated.
  2. Read https://developer.blackberry.com/cascades/reference/bb__cascades__xmldatamodel.html
    Particularly the line: The XmlDataModel is useful when prototyping a UI, since it allows a complex model to be declared in an XML file without any C++ code being written.
    In other words, you may find your requirements exceed the capabilities of this data model.
  3. Read both
    http://supportforums.blackberry.com/t5/Cascades-Development-Knowledge/Using-your-own-DataModel/ta-p/...
    and
    http://supportforums.blackberry.com/t5/Cascades-Development-Knowledge/Using-a-Custom-DataModel-to-Fi...
    If you discover you need more refined handling than you can do with an existing data model, it's actually pretty easy to make your own.

Let me know if any of this is pertinent for you - or not.   Is it perhaps possible for you to emit the itemUpdated signal?

 

Stuart

Developer
Posts: 22
Registered: ‎03-05-2011
My Device: Not Specified

Re: RSS feed - Text + images in list

Try checking this out:

http://supportforums.blackberry.com/t5/Cascades-Development/Download-Images-Dynamically/m-p/1928535/...

It works for me you just have to register the class in qml and intanciate it...