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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Regular Contributor
marcossit
Posts: 86
Registered: ‎07-19-2012
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.

 

Download my App for BB10 http://appworld.blackberry.com/webstore/content/134103/
Please use plain text.
Regular Contributor
marcossit
Posts: 86
Registered: ‎07-19-2012
My Carrier: Movistar-Venezuela

Re: Error Listview and Webview...

Error Listview and Webview...

Download my App for BB10 http://appworld.blackberry.com/webstore/content/134103/
Please use plain text.