Use WebView
I want to use WebView, so that I can show the Web page a feeling of native application. Are there good examples on the use of webview. ?
I tried the code below:
My hand UI, I click on a button, when the click on the button that I call the code below, but my opinion is always in the main INTERFACE only...
WebView * view = new WebView();
Discover-> setUrl (QUrl ("http://google.com"));
-Thank you
Hello
You will need to add it to a page or a container like other regular controls.
https://developer.BlackBerry.com/Cascades/reference/bb__cascades__webview.html
Documentation, it seems that it should be added to ScrollView make scrollable and zoomable.
If you want to show it full screen I guess you will have to create a spreadsheet, ScrollView and container inside a sheet, then add the WebView to the container. Then create & display sheet.
Tags: BlackBerry Developers
Similar Questions
-
To view documents using WebView
Hi all!
I'm new in the development of BB. Can you help me? Can I use WebView stunts for the display of documents (doc, xls, pdf, png etc.) Some, like iOS UIWebView https://developer.apple.com/library/ios/qa/qa1630/_index.html
I have tired:
{Page}
{Of container
WebView {}
ID: webView
Accessibility.Name: ' TODO: Add the contents of the property.
onLoadingChanged: {}
If (loadRequest.status == WebLoadStatus.Started) {}
Console.log ("Load has started.")
}
Else if (loadRequest.status == WebLoadStatus.Succeeded) {}
Console.log ("Load finished.")
}
Else if (loadRequest.status == WebLoadStatus.Failed) {}
Console.log ("Load failed.")
}
}
}
}
function loadData (happy) {webView.loadData (happy) ;} / / happy - QByteArray is with the content of the file}
}
But I got "Load has failed." on any docs
Find target calling card for the Docs To Go and Adobe Reader:
Docs To Go: https://developer.blackberry.com/native/documentation/cascades/device_platform/invocation/docstogo.h...
Adobe Reader: https://developer.blackberry.com/native/documentation/cascades/device_platform/invocation/adobereade... (other)
-
JavaFX how to use WebView load the local HTML page?
JavaFX how to use WebView load the local HTML page?
If the HTML code of the files in the class path, which is in the package, the load using one of the following ways:
String url = Main.class.getResource("/html/index.html").toExternalForm(); engine.load(url);
The above methods can only load files outside the class path!
-
Hi all
We use a webview prospects for our workflow and our staff are that its use is very slow.
I followed it it down to the fact that their AD accounts are members of a large number of groups and perspectives makes a call:
Find object of type Perspective with condition (audience IN ("All AD member groups"))
This tends to take a long time to enumerate all groups, so I have them connect with their administrator accounts in the meantime (less group membership), but I wonder if there is a work around to this without having access to the source code for Outlook.
See you soon,.
Dave
Hi Dave,.
We get similar feedback from another customer. Looks like the webviews could become very slow for some type of complex structure of the AD Group.
That we actively right now. Still can not configure such advertising complex group structure and reproduce it but will follow up with updates if we discover something.
Thank you
Igor.
-
How the passage of credentials to URI, to be used in the WebView Navigate method.
WinRT XAML, I use webview to display an image.
String url =
itemWebView.Navigate (new Uri (url));
I get a security exception - > a security problem has occurred. (Exception from HRESULT: 0x800C000E);
How can I pass the security credentials in the URI to view the images, which is stored on the FTP server.
Thank you
Rajeev Biligere
Hi Rajeev,
Thanks for posting your question in the Microsoft Community Forums.
The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums for further assistance:
-
I use WebView and even the stunts for the first time (I learned qt already) and I have a few questions.
How can I listen to the signal of onURLChanged() - I tried to connect to its signal in the PRC, but do not shoot my slot. I call a function in my CPP code indicating its name in qml?
I ask on qml because I think that there is connection of signals / slots in qml examples I've seen (by omitting the need to connect (mWebView, onUrlChanged(), myFunction()) but I don't see how I could connect say webview onUrlChanged (const QUrl & url) to myFunc (QUrl & myurl) located in a .cpp file using code rather than c qml ++.) Is this possible?
Also, when I open a Web using Webview page and then reload the application, I get an error momentics can prepare and download of executables which means I have to restart dev unit alpha - what should I do with webview in deconstructor to stop this requirement to reboot?
Thanks for any help you can offer.
I'm sorry, meant that the parameter names must be qualified full.
This one should work:
QObject::connect(mView, SIGNAL(urlChanged(QUrl)), this, SLOT(urlChanged(QUrl)));
void ClassName::urlChanged(const QUrl& url) { ... }
-
Hello Devs
His first question as im a newbie asks BlackBerry waterfall...
I have a site HTML5 (reactivity), I created a native application of cascade to preview the site using WebView method, as you can see below
Page { ScrollView { id: scrollView scrollViewProperties { scrollMode: ScrollMode.Both pinchToZoomEnabled: true } layoutProperties: StackLayoutProperties { spaceQuota: 1.0 } Container { background: Color.LightGray WebView { id: webViewScrollable url: "http://website.com" } } } }
the problem is when I navigate the website using the browser native blackberry that it seems fine (I can preview the images correctly and I can upload photos). but when I navigate using the application of the cascade that I created, it does not display images of the site in the manner appropriate, also unable to download any photo! Ive checked everywhere and all other smart phone browser! the site looks very good! is that all I have to add to my code to get the same preview in the native browser? is there something wrong with my simple code?
Uh, try to activate the permissions of shared files?
-
Hi, I used webview findText to find text on the page. It works fine if I do not use any webfindflag.
But when I used the flag say WebFindFlag.Backward, it throws error: "ReferenceError: can't find variable: WebFindFlag.
Container { layout: StackLayout { orientation: LayoutOrientation.LeftToRight } TextField { id: find hintText: "Type here .." } Button { text: "Find" onClicked: { if (backward.checked == true) webView.findText(find.text, WebFindFlag.Backward) else webView.findText(find.text) } } CheckBox { id: backward text: "Backward" }
thoughts?
I am able to reproduce this in BlackBerry 10.2.1 but confirmed that it was fixed in 10.3. As a workaround for 10.2.1 you can use the numeric values to WebFindFlag instead, like this:
webView.findText(find.text, 0x01)
-
Remove point default action of webview on long press
Hi all
I use WebView to view images in ListView. In the present, I use multselect do some action on LongPress on a particular image (WebView). But it shows webView point default action save, share and select other.
And by clicking on select more, show my own point action.
If I want to delete the action item default who are appearing for the first time, means that when I use longpress it show that my own actionitem.
Please suggest any suggestion for this.
Thanks in advance.
Use on your WebView code below...
WebView {}
touchPropagationMode:TouchPropagationMode.None
} -
[Issue] Make WebView with transparent background instead of the white background color
I'm developing something in Cascades and use WebView control.
By default, the background of WebView is white.
I put WebView in a container.
I want WebView has no white color background and need to be transparent and show the image in the container.
Anyone has same experience?
Thank you.
Joe
Inside your Webview, just set:
WebView {}
Settings.Background: Color.Transparent
} -
webView: load a URL from an ActionItem
Hello.
trying to do a simple display web app for a forum site and I want to put a "View Active Topics" button in the action menu and on triggered it must load the active topics page.
im a beginner...
has got everything in place, but when to trigger the button in the action menu of racing it does nothing with the following code.
{ActionItem}
Title: "View Active Topics".onTriggered: "'http://www.site.com/forum/search.php?search_id=active_topics ' "
ActionBar.placement: ActionBarPlacement.InOverflow
}You just need to assign the URL property of webview within the onTriggered function.
actions: [ ActionItem { ActionBar.placement: ActionBarPlacement.InOverflow title: "Active Topics" onTriggered: { //Using WebView ID webView.url = "http://www.site.com/forum/search.php?search_id=active_topics" } } ] WebView { id: webView url: "www.google.com" }
Thank you
Kareem.
-
I ran into a problem using WebView with of NavigationPane and reduced to a simple example that illustrates the problem.
Basically, if I push a Page containing a WebView on a NavigationPane, when I close my App, the application does not close correctly. On the device, it closes, even if it sometimes delays. On the Simulator, I have to restart the simulator that I can run my app again.
I reduced to this simple demonstration:
1. I start a new empty project Cascades, let's call it NavEg2, and I put my "main.qml" to this:
import bb.cascades 1.0
NavigationPane {}
{Page}
{Of container
layout: {DockLayout}
Button {}
objectName: "button click.
text: 'news.ycombinator.com.
}
}
}
}2. I create a 'webpane.qml' in my 'active' folder that looks like this:
import bb.cascades 1.0
{Page}
{Of container
WebView {}
URL: 'http://news.ycombinator.com'.
}
}
}3. I have change my NavEg2.hpp to:
#ifndef NavEg2_HPP_
#define NavEg2_HPP_#include
#includebb namespace {namespace stunts {class Application ;}}}
Class NavEg2: public QObject
{
Q_OBJECT
BB::Cascades:NavigationPane * root;
public:
NavEg2 (bb::cascades:Application * app);
Virtual ~ NavEg2() {}
Q_SLOT Sub buttonClicked();
};#endif / * NavEg2_HPP_ * /.
3. and I put my NavEg2.cpp on:
#include "NavEg2.hpp".
#include
#include
#includeusing namespace bb::cascades;
NavEg2::NavEg2 (bb::cascades:Application * app)
: QObject (app)
{
QmlDocument * qml = QmlDocument::create("asset:///main.qml").parent(this);
root = qml-> createRootObject();
Button * btn = root-> -
Printer using blackBerry 10 Qt to create PDF files
Hello
Is there a way I can add printer Qt in my project of stunts to make PDF files? Or y at - it another way to make PDF files without using webview and having users connect to the Internet?Better to ask in the forum of the stunts developers.
-
How to use HTML in the JavaFX controls?
JavaFX supports using HTML in the text of the JavaFX controls? For example, in the Swing components:
button = new JButton("<html><font face=arial size=16><center><b><u>E</u>nable</b></font><br>" + "<font face=cambria size=12 color=#ffffdd>middle button</font></html>");
If not, we could find a workaround?
Incorporating a WebView in a label for the HTML rendering
A WebView is a node that displays HTML.
Most of the controls implement labelled, or have elements that are labeled.
One labeled has a method setGraphic (node) that allows you to establish the chart attached to the label of a node given (including a WebView).
For example:
WebView webview = new WebView(); webview.getEngine().loadContent("
Enable
middle button"); webview.setPrefSize(150, 50); Button buttonWithHTML = new Button("", webview);need to create a button with html in there (I didn't actually try running the example above).
Aside time to start relatively slow on first use and overhead costs (which I can't quantify) to use WebView in this way, there are a couple of jira exceptional applications that are a bit annoying.
RT-25004 allow transparent backgrounds in WebView
RT-25005 favorite auto sizing for WebView
You can vote for applications above jira or comment if such a feature is important to you.
FXML/TextFlow/CSS Alternative
Rather than using html in the labelled, TextFlow control support was introduced in Java 8, so that could be used instead.
TextFlow also works well with FXML and css if you prefer to have the stuff in the TextFlow handled via a markup and a declarative style language.
Open feature request
There is a feature open request RT-2160 HTML support for text , which is currently scheduled for implementation in the initial release of Java 8. I think the likelihood of it actually included it is zero percent, if it can be considered for a future version. You can vote for the issue or add comments to it or provide an implementation if you are so inclined.
Implementation considerations
A possible implementation would be something that analyzes the HTML and then built a TextFlow HTML parsed according to the rules that are set out laborious mind-numbing detail in the specification HTML5 treatment.
You can use an HTML parser relaxed such as the analysis of validator.nur (even though there may be others who would be a better fit).
A simple implementation would be just to use the Analyzer in the jdk that is used for the swing controls, but that is hopelessly outdated.
Perhaps, even simpler would be to accept only html strict entry and just use SAX to parse out, although things like validator.nu are too difficult to work with.
Then, to the limited number of analyzed tags that you want to support (and you don't want to really not compatible with HTML5 all for something like this - otherwise use just WebView), create your TextFlow of the DOM who created your Analyzer.
I wouldn't even both trying to handle most of the things in your html string in your application, stuff to do with style, fonts, colors, etc. These things were never in any case any good html and css is better for their handling, so just support things commonly used in modern day regular html (take a look at the HTML source "bootstrap" for example to see what it might be - if bootstrap uses her, I don't think not that you support it). Things will support you are things around structure of document as lists, headings, etc. div blocks and cover the nodes - so only to implement this kind of important things and delegate all the rest to css where it belongs.
Also, make sure that your implementation is part of the FXML so that you can easily integrate your html subset in a doc FXML.
-
JavaFX 2.0 WebView crashes if the application is signed
I use WebView to provide a set of help pages in my application.
The help pages are included in a resource directory called html.
I get the first URL with the following lines of code:
Index URL = NgpConfiguratorApp.class.getResource("/html/index.html");
String url = "file://" + index.getPath ();
I then open the URL with WebView and it works perfectly.
I am able to browse my help pages perfectly.
However if I sign the pot (of in NetBeans using the valid signature 6 months) and then run the program, everything works perfectly (access of database XML import/export etc.) until I tried access help pages through WebView to which PR\648606FR the program hangs up completely.
Is this a bug in the Web view or am I missing something. I've included the complete class list below.
COMPLETE LIST
============
SerializableAttribute public class HelpBrowser extends scene {}
public HelpBrowser() {}
Super();
init();
}
private void init() {}
Point primaryStage = new Stage();
primaryStage.setTitle ("AviatorCalc Help Pages");
Index URL = NgpConfiguratorApp.class.getResource("/html/index.html");
String url = "file://" + index.getPath ();
Root of group = new Group();
primaryStage.setScene (new Scene (root));
WebView view = new WebView();
view.setMinSize(1024, 768);
view.setPrefSize(1024, 768);
final WebEngine eng = view.getEngine ();
Eng. Load (URL);
final locationField TextField = new TextField (url);
locationField.setMaxHeight (Double.MAX_VALUE);
GoButton button = new Button ("Go");
BackButton button = new Button ("Back");
goButton.setDefaultButton (true);
goButton.setId ("browserbutton");
EventHandler < ActionEvent > goAction = new EventHandler < ActionEvent > () {}
@Override
{} public void handle (ActionEvent event)
Eng. Load (locationField.GetText (). StartsWith("")? locationField.getText)
(: ' "+ locationField.getText ());
}
};
goButton.setOnAction (goAction);
locationField.setOnAction (goAction);
eng.locationProperty () .addListener (new ChangeListener < String > () {}
@Override
public void changed (ObservableValue <? extends String > observable, String oldValue, String newValue) {}
locationField.setText (newValue);
}
});
Grid GridPane = new GridPane();
grid.setVgap (5);
grid.setHgap (5);
GridPane.setConstraints (locationField, 0, 0, 1, 1, HPos.CENTER, VPos.CENTER, Priority.ALWAYS, Priority.SOMETIMES);
GridPane.setConstraints (goButton, 1, 0);
GridPane.setConstraints (goButton, 2, 0);
GridPane.setConstraints (display, 0, 1, 2, 1, HPos.LEFT, VPos.CENTER, Priority.ALWAYS, Priority.ALWAYS);
grid.getColumnConstraints (.addAll)
New ColumnConstraints (500, 100, Double.MAX_VALUE, Priority.ALWAYS, HPos.CENTER, true);
New ColumnConstraints (40, 40, 40, Priority.NEVER, HPos.CENTER, true));
grid.getChildren () .addAll (locationField, goButton, view);
grid.getChildren () .addAll (view);
root.getChildren () .add (grid);
primaryStage.show ();
}
}This seems suspect-online
URL index = NgpConfiguratorApp.class.getResource("/html/index.html"); String url = "file://" + index.getPath();
In my view, adding the file:// Protocol when the resource is loaded from the pot will not.
To load html from the classpath in WebView all that you need to do is place the HTML is the same package as the class Java calling the load method and call:
engine.load(getClass().getResource("mypage.html").toExternalForm());
Maybe you are looking for
-
Equium P200-1ED is able to power external USB devices connected on it?
(1) is anyone able to confirm if the Toshiba Equium P200-1ED is capable of powering an external USB device connected to it via one of its 6 USB ports? (2) what is the maximum power that the Toshiba Equium P200-1ED can provide only one USB port? (3) c
-
HP Touchsmart 530 running Win 7 64 bit. How to disable the functionality of remote control on my pc. When the DirecTV remote is used, the white light at the front of the PC flashes. Sometimes the PC will respond in a strange way. Example: Installing
-
Keep due to lack of updates of Windows Vista Edition Home Premium
I have Windows Vista Home Premium SP1, and it is configured to search for and install updates automatically. I recently had to change this setting if the manual I received an update on the last update failure message try. The computer attempts to dow
-
He said: "there is a problem with this installation package. a program required for this installation could not be completed, contact your provider of batch original title: itunes is not installed.
-
I bought a copy of Windows 7 with a bad product so key to make a long story short. I made a backup before loading Windows 7. I reloaded Vista Home premium 64-bit at the beginning to start again, but I'm having a problem charging backup set. I put the