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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 188
Registered: ‎07-19-2012
My Device: Z10 Limited Edition and Dev Alpha C
My Carrier: Movistar-Venezuela

Error Listview and Webview...

I have the following code courtesy of http://bbcascades.com/  Written by Brian S.

 

     Page {
         titleBar: TitleBar {
             title: "Newsday"
         }
         Container {
             ListView {
                 id: myListView
  
                 dataModel: myDataModel
                 listItemComponents: [
 ListItemComponent {
                         type: "header"
                         Container {
                        layout: DockLayout {
                        }
                        Label {
                                 text: "Noticias"
                             }
                         }
                     },
 ListItemComponent {
                         type: "item"
  
                         // Custom List compoents
                         Container {
                             Label {
                                 text: ListItemData.title
                                 textStyle.fontWeight: FontWeight.Bold
                                 multiline: true
                             }
                             Label {
                                 text: ListItemData.pubDate
                             }
                             Label {
                                 text: ListItemData.description
                                 textStyle.fontSize: FontSize.Small
                                 multiline: true
                             }
                             Divider {
                             }
                         }
                     }
                 ]
                 onTriggered: {
                     var feedItem = myDataModel.data(indexPath);
                     var page = detailsPage.createObject();
                     page.htmlContent = feedItem.link;
                     newsPane.push(page);
                 }
             }
         }
     
     attachedObjects: [
  GroupDataModel {
            id: myDataModel
            sortingKeys: [
                "order"
            ] //[  "pubDate" ]
            grouping: ItemGrouping.ByFirstChar
            sortedAscending: true
        },
        DataSource {
            id: myDataSource
            source: "http://newsday.co.tt/rss.xml"
            query: "/rss/channel/item"
            type: DataSourceType.Xml
            onDataLoaded: {
                myDataModel.clear();
                myDataModel.insertList(data)
            }
        },
        ComponentDefinition {
            id: detailsPage
            Page {
                property alias htmlContent: detailsView.url
                Container {
                    layout: DockLayout {
                    }
                    Container {
                        ScrollView {
                            scrollViewProperties.scrollMode: ScrollMode.Both
                            scrollViewProperties {
                                pinchToZoomEnabled: true
                                maxContentScale: 5
                                minContentScale: 1
                            }
                            WebView {
                                id: detailsView
                                settings.zoomToFitEnabled: true
                                settings.activeTextEnabled: true
                                onLoadProgressChanged: {
                                    // Update the ProgressBar while loading.
                                    progressIndicator.value = loadProgress / 100.0
                                }
                                onLoadingChanged: {
                                    if (loadRequest.status == WebLoadStatus.Started) {
                                        // Show the ProgressBar when loading started.
                                        progressIndicator.opacity = 1.0
                                    } else if (loadRequest.status == WebLoadStatus.Succeeded) {
                                        // Hide the ProgressBar when loading is complete.
                                        progressIndicator.opacity = 0.0
                                    } else if (loadRequest.status == WebLoadStatus.Failed) {
                                        // If loading failed
                                        html = "<html><head><title>Loading Failed</title></head> 
                                                 <body>Check Internet connection?</body></html>"
                                        progressIndicator.opacity = 0.0
                                    }
                                }
                            }
                        }
                    }
                    Container {
                        bottomPadding: 25
                        horizontalAlignment: HorizontalAlignment.Center
                        verticalAlignment: VerticalAlignment.Bottom
                        ProgressIndicator {
                            id: progressIndicator
                            opacity: 0
                        }
                    }
                }
            }
        }
    ]
    onCreationCompleted: {
        myDataSource.load();
    }
}

 IMG_00000139.png

 

When I click the Webview not working, not working what could be the error?

 

If I want to add an image to each entry How can I?

 

PS: This code was created by Brians. of http://bbcascades.com/ and not my creation.

 


Follow me in Twitter:

@Marcossit

BBM Channel:

MarcossitDev: C0002C366  

DeviceSuite For BlackBerry 10:

Link to Download DeviceSuite:

Support was successful? Accept as Solution and click on:


Developer
Posts: 188
Registered: ‎07-19-2012
My Device: Z10 Limited Edition and Dev Alpha C
My Carrier: Movistar-Venezuela

Re: Error Listview and Webview...

Error Listview and Webview...


Follow me in Twitter:

@Marcossit

BBM Channel:

MarcossitDev: C0002C366  

DeviceSuite For BlackBerry 10:

Link to Download DeviceSuite:

Support was successful? Accept as Solution and click on: