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
Developer
Posts: 82
Registered: ‎01-11-2013
My Device: DevAlphadevice
My Carrier: rim

Webview issue in z10 cascades app

Hi,

 

I am using webview api to open webpage in my app ,i have two buttons in my php webpage ie download button to download pdf file,play button for video ,these two things working fine in browser but not working when opned through webview in my app ,so plz help to slove its very urgent.

Highlighted
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Webview issue in z10 cascades app

What do you mean by not working?

Please post your code.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 82
Registered: ‎01-11-2013
My Device: DevAlphadevice
My Carrier: rim

Re: Webview issue in z10 cascades app

My webview code

 

import bb.cascades 1.0
Page {

content: Container {
Container {
layout: DockLayout {
}

horizontalAlignment: HorizontalAlignment.Fill
ImageView {
imageSource: "asset:///images/top_bar.png"
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Top
}
Container {
layout: StackLayout {
}
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
//topPadding: 20
Label {

// The title is bound to the data in models/recipemodel.xml title attribute.
text: "AAAAAAAAAA"
textStyle {
fontWeight: FontWeight.Bold
color: Color.create("#ffffff")
}
}
} // end of text container
Container {
leftPadding: 3
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
horizontalAlignment: HorizontalAlignment.Left
verticalAlignment: VerticalAlignment.Center
ImageButton {
defaultImageSource: "asset:///images/back_btn.png"
pressedImageSource: "asset:///images/back_btn_down.png"
onClicked: {


}

app.setWidgetChainPresent(false);

}

}
} //image container
}

Container {
layout: DockLayout {
}


// To enable scrolling in the WebView, it is put inside a ScrollView.
ScrollView {

// Scrolling is restricted to vertical direction only, in this particular case.
scrollViewProperties {
scrollMode: ScrollMode.Both
}

WebView {
url:"http://campaign.pointart.mobi/sugerfree/smartphones/home.php?uid=138246015502847951&wid=50153"
// settings.zoomToFitEnabled: {true}
settings.javaScriptEnabled: {true}
settings.imageDownloadingEnabled: {
true
}
settings.activeTextEnabled: {
true
}

settings.cookiesEnabled: {
true
}
settings.webInspectorEnabled: {
true
}

settings.viewport: { "width" : "device-width", "height" : "device-height","initial-scale" : 1.0 }
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill


onLoadingChanged: {

if (loadRequest.status == WebLoadStatus.Started) {
myIndicator.visible = true;

} else if (loadRequest.status == WebLoadStatus.Succeeded) {

myIndicator.visible=false;
myIndicator.stop();

} else if (loadRequest.status == WebLoadStatus.Failed) {
// If loading failed, fallback to inline HTML, by setting the HTML property directly.
html = "<html><head><title>Fallback HTML on Loading Failed</title><style>* { margin: 0px; padding 0px; }body { font-size: 48px; font-family: monospace; border: 1px solid #444; padding: 4px; }</style> </head> <body>Oh ooh, loading of the URL that was set on this WebView failed. Perhaps you are not connected to the Internet?</body></html>"

}
else if(loadData("laoding,,"))
{
console.log("if loading **bleep** here")
}
}

// This is the Navigation-requested signal handler so just print to console to illustrate usage.
onNavigationRequested: {
console.debug ("NavigationRequested: " + request.url + " navigationType=" + request.navigationType)
}
}
}// ScrollView
ActivityIndicator {
id: myIndicator
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
running: true
preferredWidth: 240.0
preferredHeight: 240.0
visible: false
}
// A progress indicator that is used to show the loading status

}// RecipeContainer
}
onCreationCompleted: {
myIndicator.visible =true;



}
}// RecipePage

 

 

This is my code to open the metioned url in webview,

This code is opening given url(php)  in webview,but in this url i have to controls like 1>download buttoon 2>Tvc  button to play 3gp video file 

so these two php page controls not working in my webview code from my Application  so what is ths reason plz help me

same url i checked in z10 browser its working fine .

 

Developer
Posts: 82
Registered: ‎01-11-2013
My Device: DevAlphadevice
My Carrier: rim

Re: Webview issue in z10 cascades app

plz tell me whether this iisue is from php link side or from my z10 code
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Webview issue in z10 cascades app

[ Edited ]

Please use the 'Insert Code' button when including code in your posting, this is the clipboard icon with a 'C' in it. This way your code will be easier to read and likely to get a better response.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Webview issue in z10 cascades app

Have you tried loading the page in the device browser and seeing if it works or not, this will give you a clue?


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 82
Registered: ‎01-11-2013
My Device: DevAlphadevice
My Carrier: rim

Re: Webview issue in z10 cascades app

 

Thanks for ur reply

 

I checked in device browser it is working fine ,so please tell me whether this issue is from php side or my z10 code side

I also checked that 3gp video link by my another qml videoplayer class in my app it is playing fine ,but olny when i try to play from php page it giving error unsupported media type.

 

plz help me