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

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.

Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
annadanesh
Posts: 82
Registered: ‎01-11-2013
My Device: DevAlphadevice

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 .

 

Please use plain text.
Developer
annadanesh
Posts: 82
Registered: ‎01-11-2013
My Device: DevAlphadevice

Re: Webview issue in z10 cascades app

plz tell me whether this iisue is from php link side or from my z10 code
Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
annadanesh
Posts: 82
Registered: ‎01-11-2013
My Device: DevAlphadevice

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

Please use plain text.