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

Tags: BlackBerry Developers

Similar Questions

  • WebView with windows 7 Proff and IE 8

    We are trying to run customer Cisco webview webview (windows 7 Professional with IE 8) Machine is accessible but when generate us any report we had the following error Message:

    (((Error. The server encountered an unexpected condition which prevented him from meeting the demand.

    java.util.MissingResourceException: can't find resource for bundle java.util.PropertyResourceBundle, US - key

    at java.util.ResourceBundle.getObject(ResourceBundle.java:325)

    at java.util.ResourceBundle.getString(ResourceBundle.java:285)

    at pagecompile._webview._ReportNewDateTime_xjsp._jspService(_ReportNewDateTime_xjsp.java:322)

    at com.newatlanta.servletexec.JspHttpJspPage.service(JspHttpJspPage.java:41)

    at com.newatlanta.servletexec.JspServlet.service(JspServlet.java:1036)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

    at com.newatlanta.servletexec.SERequestDispatcher.forwardServlet(SERequestDispatcher.java:638)

    at com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDispatcher.java:236)

    at com.newatlanta.servletexec.SERequestDispatcher.internalForward(SERequestDispatcher.java:283)

    at com.newatlanta.servletexec.ApplicationInfo.processApplRequest(ApplicationInfo.java:1827)

    at com.newatlanta.servletexec.ServerHostInfo.processApplRequest(ServerHostInfo.java:937)

    at com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1091)

    at com.newatlanta.servletexec.ServletExec.ProcessRequest (ServletExec.java:1002)))

    any help would be appreciated

    I've heard of this problem of colleagues and of the solution they gave me is as follows. I have not tried, but my source is very reliable and competent.

    If it solves the problem, THANKS for posting back

    ------------------------

    Locale WebView files are incorrectly configured with language = en - us, but it must be en-US.

    You can either insert a work around in your Internet Explorer Tools, languages, by adding a new section (with optional user-defined) "en - us", then push it to the top of the languages.

    Or you can change the regional settings on each server WebView file and add an entry in the US, then cycle Jaguar and IIS Admin services.

    Problem should be fixed.

    ---------------------------------

    Kind regards

    Geoff

  • [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
    }

  • Components of access QML in c ++ with navigationpane

    I used the code works like a charm, but I want to access the user interface below the elements that are present in the item Page how do I am getting the below but the application breaks down

    I have a NavigationPane in file c ++ and the page must be pushed after the button is clicked.

    QmlDocument *qml = QmlDocument::create("asset:///SearchResults.qml").parent(this);
        qml->setContextProperty("peoplefinder", this);
    
        Page *mypage = qml->createRootObject();
        qml->setParent(mypage);
    
        ActivityIndicator *myindicator = qml->findChild("myIndicator");
        qDebug()  << myindicator->isVisible();
    
        mNavigator->push(mypage);
    

    Please help me how do I tried access also the child ActivityIndicator through my object page but am unable to do so.

    its page-> findChild<>() and not-> findChild qml

  • OS 10.3 / WebView: no interaction with the Google Maps Javascript API

    Hello

    Google Maps Javascript API no longer works correctly using the Web on OS 10.3.  On all the operating system previous releases everything worked perfectly fine in WebView but on OS 10.3 even if the plan (or view, or anything else provided by Google APIs) is displayed correctly, there is no interaction whatsoever with it - no response to taps, none is panoramic, no zoom, etc.

    I don't speak of the 10.3.0.698 Simulator - I do not have access to the true OS 10.3 device.

    Even simple examples of Google Maps doesn't work, try for example:

    import bb.cascades 1.2
    
    Page {
        Container {
            preferredHeight: 720
            preferredWidth: 720
            WebView {
                preferredHeight: 720
                preferredWidth: 720
    
    url: "https://google-developers.appspot.com/maps/documentation/javascript/examples/full/marker-simple"
            }
        }
    }
    

    The map appears, but there is absolutely no interaction with it - just a STATIC content.  On OS 10.2.xxxx, it works perfectly fine...

    P.S. If you open the same example URL directly in the web browser on OS 10.3 everything works well - responds to taps, she can be zoomed, panned, etc..    So, it's apparently a problem with user agent (which is probably the same web browser both webview).  Change the user agent in WebView to e.g. Z10 user agent doesn't help, either.

    Can anyone help?

    Your sample application does not seem to suffer the original bug, I thought. That bug could cause a WebView with no ancestor ScrollView would get too small window Visual and tactile input would be anchored to the Visual display window very small. If you want to learn more on this topic, see a tale of two windows - part for the discussion of Visual and updated display on the page. Perhaps your sample application it is OK because it specifies a preferredHeight for Web display, which can affect the used Visual display window.

    To be more precise, on a real device of passport BlackBerry running OS versions 10.3.0.1052 and 10.3.0.1154, the sample you provided responds perfectly to press ENTER.

    However, on the Simulator on OS 10.3.0.698, I can confirm input touchscreen does not work. Therefore a separate bug, which seems to be specific to the Simulator.

    I think you can be assured that end users will still be able to use your app (s) on a real passport of BlackBerry device, but it is unfortunate that it does not work on the Simulator.

  • Webview from landscape orientation to portrait mode causes the font size to become smaller and a problem with the context Menu

    Hi, I have a webview with inline html. It works fine except that when I pass in landscape mode, the screen fills fine and the police grows, but when I go back to portrait fonts are tiny, even smaller then when initially in the portrait. I am installing this on a Z10 with cascades 10.1 SDK. Is this a Bug somewhere in the SDK or BB10?

    Another problem I have is in Web mode, the shortcut menu appears when I touch a Word. I is no need to use the context menu. How can I get rid of him. In the case where I would like to someday use this menu, I would need to add code to it. I can't find the code. Where can I find it?

    Thanks for your help

    Concerning

    Roland

    I' to propose taying far WebView as much as possible and using TextArea (with type HTML). There are still a few bugs present in WebView that make it unpleasant to use.

    You cannot get rid of the context menu, so it will disappear once you remove WebView. You can still share with other methods.

    This may seem more work and it's probably, but it's going to do to improve the user experience and fewer headaches for you.

  • WebView: cannot scroll through long lists drop-down/select

    I added webview standard, but are unable to scroll through long lists on drop-down lists (html select). It shows just the best selections and im unable to scroll in the list to select something lower.

    Someone else has webview with selection lists for a long time who have this problem, or do NOT have this problem?

    the latest version of the OS fixed this! So update your OS to dev for the device and you should be ok!

  • Crash error NavigationPane on Simulator of Q10

    Hi everyone, I have a problem with NavigationPane on Simulator of Q10.

    This is my code:

    fprintf(stderr,"1---\n");

    Page * = navigationPane topPage (Page *)-> top();

    fprintf(stderr,"2---\n");

    navigationPane isn't a NULL pointer and contain a page. He hang on line code 2.

    Simulator Z10 is OK, but on the simulator of Q10 he plant? I made a mistake, or is this a bug?

    Thanks for any answer!

    Found, I found it, so it's own by another thread, it crash when the main thread access and I solved the problem with Threads and it OK now

  • CODE "NavigationPane.deprecatedPushQmlByString ("QMLFile.qml")' FAIL

    Hey everybody,

    IM creating the menu for my application system.

    NavigationPane {} with multiple pages.

    NavigationPane {
        id: navigationPane
        Page {
            Container {
                background: Color.Black
                layout: AbsoluteLayout {
                }
                ImageView {
                    id: imageViewID
                    imageSource: "asset:///images/LogoNewsChannel.png"
                    scalingMethod: ScalingMethod.Fill
                    translationX: 210.0
                    translationY: 250.0
                    scaleX: 2.0
                    scaleY: 2.0
                }
                Label {
                    text: "News Channel_BB10"
                    translationX: 220.0
                    translationY: 40.0
                    scaleX: 1.5
                    scaleY: 1.5
                    textStyle {
                        base: SystemDefaults.TextStyles.BigText
                        fontWeight: FontWeight.Bold
                        color: Color.Yellow
                    }
                }
                Button {
                    id: button1
                    text: "Noticias"
                    imageSource: "asset:///images/LogoNewsChannel.png"
                    layoutProperties: AbsoluteLayoutProperties {
                        positionX: 10
                        positionY: 800
                    }
                    onClicked: {
                        navigationPane.deprecatedPushQmlByString("noticias.qml");
                    }
                }
    

    This maim.qml call to other pages to make the action but when I push the 'low' for example, notice the application is no not anything. I had read that these codes NavigationPane.deprecatedPushQmlByString ("QMLFile.qml") had been kidnapped.

    I tried with navigationPane.push (QMLFile.qml); but any

    How can I do to call or call the calibrated page open aplication but run only the home page

    Thank you

    I followed the instructions

    Button {
                    id: button1
                    text: "Noticias"
                    imageSource: "asset:///images/LogoNewsChannel.png"
                    layoutProperties: AbsoluteLayoutProperties {
                        positionX: 10
                        positionY: 800
                    }
                onClicked: {
                var page = pageDefinition5.createObject();
                      navigationPane.push(page);
                      }
                     attachedObjects: ComponentDefinition {
                     id: pageDefinition5;
                     source: "noticias.qml"
                       }
    

    but does nothing, if anyone has any other form... I keep calling the main.qml page

  • WebView URL of XML data

    Hello

    I created a Listview and ListItemComponents .xml file

    I would like to open a WebView with the url selected in the .xml file, when a user clicks on an element.

    That's what I have so far:

    hand. QML

    import bb.cascades 1.0
    
    TabbedPane {
        showTabsOnActionBar: false
        Tab {
            title: "Home"
            imageSource: "asset:///images/custom/icon_197.png"
            Page {
                id: homepage
    
                titleBar: TitleBar {
                        title : "Title"
                    }
                    content: Container {
                        // Create a ListView that uses an XML data model
    
                        ListView {
                            dataModel: XmlDataModel {
                                source: "models/home.xml"
                            }
    
                            listItemComponents: [
    
                                ListItemComponent {
    
                                    type: "header"
    
                                    // Use a predefined Header to represent "header"
                                    // items
                                    Header {
                                        title: ListItemData.title
                                        subtitle: ListItemData.subtitle
                                    }
                                },
                                ListItemComponent {
                                    type: "listItem"
    
                                    // Use a predefined StandardListItem to represent "listItem"
                                    // items
                                    StandardListItem {
                                        title: ListItemData.title
                                        description: ListItemData.subtitle
                                        status: ListItemData.status
                                        imageSource: ListItemData.image
    
                                    }
    
                                } // end of second ListItemComponent
    
                            ]
                                            onTriggered: {
                                                var chosenItem = dataModel.data(indexPath);
    
                                                // Create the content page and push it on top to drill down to it.
                                                var page = webviewID.createObject();
    
                                                // Set the title and source of the feed that the user selected.
                                                page.weburl = ListItemData.weburl
                                                page.title = chosenItem.title
    
                                                nav.push(page);
                                            }
                             // end of listItemComponents list
                        } // end of ListView
                    } // end of Container
    
                actions: [
                    ActionItem {
                        title: "About"
                        imageSource: "asset:///images/custom/bb10/ic_info.png"
                    },
                    ActionItem {
                        title: "Settings"
                    }
                ]
    
            }
    
                 attachedObjects: [
                      ComponentDefinition {
                          id: webviewID
                          source: "webview.qml"
                      }
                  ]
    
        }
        Tab {
            title: "Options"
            Page {
                id: page2
                actions: [
                    ActionItem {
                        title: "Edit"
                    },
                    ActionItem {
                        title: "Save"
                    }
                ]
            }
        }
        Tab {
            title: "Help"
            Page {
                id: page3
                actions: [
                    ActionItem {
                        title: "Search"
                    },
                    ActionItem {
                        title: "Browse"
                    }
                ]
            }
        }
    
    }
    

    WebView.QML

    import bb.cascades 1.0
    
    Page {
        property alias title: titleBar.title
        property variant chosenItem
        property alias html: ListItemData.html
        property variant weburl
        titleBar: TitleBar {
            id: titleBar
        }
        WebView {
            id: webView
    
        }
    }
    

    Home.Xml

    
        http://www.google.nl"/>
        http://crackberry.com"/>
    
    

    Help, please!

    Thanks in advance, Jeroen

    The fixed.

    More info and code: http://forums.crackberry.com/bb-10-developers-hangout-f276/webview-url-xml-data-808285/

  • Use on QImage QPainter

    I'm looking at ways to generate images running. I have been informed that Cascades does not support the fields defined by the user (i.e., I would like to write a class that implements the logic of painting and layout). It was suggested that QPainter could be used to generate the image on a QImage and Image that should be assigned to the picture property of an ImageView and then convert with QImage.

    In order to do this, I wrote code like this:

    MyClass::image() QVariant
    {
    QString str ("Hi");

    QImage image (QSize (100,100), QImage::Format_RGB32);

    QPainter painter (&image);)
    painter.fillRect (0, 0, 100, 100, Qt::white);

    painter.setPen (Qt::blue);
    painter.setFont (QFont ("Arial", 30));

    Causes Segmentation fault!
    painter.drawText (0, 0, 100, 100, Qt::AlignCenter |) Qt::AlignHCenter, str);

    PB of PixelBufferData (PixelBufferData::RGBX, 100, 100, 100, image.bits ());

    QVariant var (QVariant::Image);
    var.setValue (Image (pb));

    return var;
    }

    Unfortunately, this method generates a Segmentation fault when calling drawText. Autour Googling reveals that others face this in the world of Qt with QPainter in the absence of a QApplication object.

    So my question is: QPainter can be used in an application of Cascades? If so, there are samples? If not, what would be the best way to generate images on the fly (for example, a field that displays a result bar graph of the data, etc.)

    Thank you

    Jamie

    You studied WebView with a canvas JS, or OpenGL?

    Stuart

  • App freezes out post if JS alert is not rejected

    Hello

    I noticed that with a simple application that contains a WebView, if a Javascript alert appears, did not not reject while the app is closed, lfwa remains semi transparent on the dashboard BB10 and cannot be reopened.

    It is a simple code QML containing a WebView with a button that displays an alert:

    WebView {
    
        html: "
                "
    
    } //webview
    

    The developer during a test/debugging solution is opening the prospect of system information and sending a signal SIGTERM app.

    This problem is similar to that of this other thread

    http://supportforums.BlackBerry.com/T5/Cascades-development/Beta-4-WebView-app-freeze-post-exit/TD-p...

    but I learned to make a new thread.

    Kind regards

    Pepe

    This usually indicates a memory problem or a process without end.

    If the code you have posted is really all to reproduce that so it's a bug of BB10 and you must present JIRA.

  • Some issues of the Wavemaker fling

    After playing a bit with the wavemaker projects and widgets, I have a few questions.

    First of all, it would be really interesting to know if it's only once or if it's a glimpse of something still more complete, a little further on the line. I realize that vCAC is probably the major effort for portals self-service at this stage, but for small deployments, something like that makes a lot of sense.

    Secondly about the project as it is today I wonder how I can use this to post actually a specific set of workflow - all widgets seem to be 'all-in' somehow and I can find just run a specific workflow.

    Finally, there is advice here and there but no actual docs on the use of access controls by session with passthrough authentication information. I suspect that it is possible, using the UNIQUE vCenter authentication service, but without the docs, it's a lot of trial and error.

    In any case, thanks for the publication of what I suspect may be a project that took a 90-degree turn WaveMaker sold on. It's a hell of an improvement on the pure wavemaker of integration REST previously required.

    The story of this adventure is the following: a couple of years, it was obvious the webviews / operator web / prospects could not support since relying on the old Tapestry / framework dojo that couldn't be updated without breaking any compatibility.

    VCO with is the new powerful REST API and VMware Wavemaker who bought it made sense to replace the webview with WaveMaker widgets functionality. This has been researched / attempt to.

    Then Wavemaker has been sold. The engineers working on this project did not want the current effort to be wasted, so now their private, time they did the extra steps to make it available as an opensource fling. It took a lot of time to this end the right way with involving the legal part.

    WaveMaker is maintained, there was already a tempted by our customers / partners doing custom integrations to vCO Wavemaker, this adventure can be a very good starting point and can be updated / extended since it's open source.

    That said, this is a one-time project since the engineers who worked on it are now very busy working on the next version of vCO / vCAC.

  • How to insert images in the content pane HTMLEditor?

    How to insert images in the content pane HTMLEditor? or a hyperlink?

    > know the position of the caret

    Well, there is no public API on the HtmlEditor to know that.

    You could create an tweak asks to add such an api.

    In the meantime, I believe that the HtmlEditor is implemented as a contentEditable has WebView below, so I think it's possible to hack together a solution if you want to.

    To do this:

    1. create a program that uses the HtmlEditor.

    2. run the program and use ScenicView to work on the css to display embedded Web search path.

    3. Once your HtmlEditor appears on a scene, use a node search to dig up a reference to the Web view.

    4. Once you have a reference to the Web mode, use executeScript to get the position of the caret by using JavaScript.

    5. Once you know where the caret, use a mechanism similar to my example program above to allow you to insert an image to the location of the caret (get the html text, put the position appropriate, up-to-date then set it again).

    Of course, you don't need to use a HtmlEditor control to do this, you can also just use a plain WebView with contentEditable flag put on it or any number of 3rd party JavaScript html editors have image insert functions.

  • Bundle Native Bird java.security.NoSuchAlgorithmException

    I am trying to build a native bundle, especially for mac os x, but also in windows. And in both environments the .app, .dmg, .exe download generated correctly, but when I run it, I get a lot of exceptions java.security.NoSuchAlgorithmException. For example:
    Caused by: java.security.NoSuchAlgorithmException: SunTlsRsaPremasterSecret not available KeyGenerator

    Caused by: java.security.NoSuchAlgorithmException: SecretKeyFactory PBEWithMD5AndDES unavailable

    My program uses security TLS connections in xmpp. And I also have a webview with HTTPS which does not load eighter.

    Does anyone have any idea why this might be happening?
    I acknowledge that if I run the generated only jar, it in works very well, it only happens with the .exe and. app.
    It's my build.xml fx: deploy code:

    "< fx: deploy width =" ${javafx.run.width} "height =" ${javafx.run.height} ".
    nativeBundles = "all".
    OutDir = "${basedir} / ${dist.dir} ' outfile =" ${application.title} ">"
    < fx:application name = "${application.title}" "
    mainClass="${javafx.main.class}"/ >
    < fx:resources >
    < fx:fileset dir = "${basedir} / ${dist.dir} '"
    includes = "*.jar" / >
    < fx:fileset dir = "${basedir} / ${dist.dir}" includes="lib/*.jar"/ > "
    < / fx:resources >
    < fx:info title = "${application.title}" "
    Vendor = "${application." Vendor} "/ >"
    < / fx: deployment >

    Appreciate your help.

    Published by: ascuccimarra on February 20, 2013 13:36

    This solution might work for you.
    http://StackOverflow.com/questions/13356633/JavaFX-WebView-not-loading-HTTPS-page/13599131#13599131

Maybe you are looking for