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!

  • Use Webview Outlook slow

    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 =

    'https://UserId:Password@Server:8443/mobiledoc/ecwimage?filename=9378_1C10857B-A9A4-42AD-A6B0-BD63794239CA.jpg&filepath=/mobiledoc/2013/03252013&operation=download&TrUserId=122';

    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:

    Windows Store apps MSDN Forums

  • WebView - a few questions

    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)
    {
      ...
    }
    
  • problems with WebView

    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?

  • search for text in webview

    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.

  • WebView with NavigationPane

    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
    #include

    bb 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
    #include

    using 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->findChild button ("click");
    Connect (btn, SIGNAL (clicked ()), this, SLOT (buttonClicked ()));
    App-> setScene (root);
    }

    Sub
    {NavEg2::buttonClicked()}
    QmlDocument * qml = QmlDocument::create("asset:///webpane.qml").parent(this);
    root-> push (qml->()) createRootObject;
    }

    Then I have my setup to build the Simulator-Debug value, build the project and create a run Configuration to run on the Simulator.

    When it runs on the Simulator, it works as expected, but when I close the application, it does not close. The icon will "grey" and I can not run the application again without having to restart the Simulator. If I click on the button - that is, if I do not open the WebView - then it closes very well. So I somehow does not use the WebView properly within the NavigationPane.

    When I run the present on the device Dev Alpha, it takes time for the App close (about 5 seconds), but it ends by closes. It reminds me to some WebView discussions there do something, or the device is just much more cruel to kill apps...

    Someone at - it ideas?

    Help much appreciated,
    Craig

    Hi Brian,.

    This is great news - had been worried I did something wrong. Thank you very much

    C

  • 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