02-23-2013 07:46 PM
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();
}
}
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.
02-24-2013 03:33 PM
Error Listview and Webview...