WebView (10.1.0.273, 10.1.0.1435) showed that 3mm in height. 10.0.9/10.0.10 is OK.

Hello

I checked my file (stored in the phone) local html in HTML5 OK.

He showed good, filling the entire screen on v10.0.X z10 and q10.

However, on 10.1.X e.g. 10.1.0.273, 10.1.0.1435, it is only 3mm in height.

Appreciate advice.

* Update: found by webinspector dimension html element width & height to 10.1 is detected as 342 x 7 px while 10.0.X is 342 x 570px. Anyone with an explanation why is it the case? Guess I can fix by defining for example 342px to height to work around.

* Workaround solution: managed to obtained a solution using CSS media query to adjust height until I have found why 100% is interpreted as "7px" by 10.1 when the full width of 10.0.

Solution: Use Innovatology suggestion.

Thank you
James Tan

-My CSS for the Web of google map-


-My Webview in QML call is very simple-

WebView {
    id: webView
    url: "local:///assets/webview/index.html"
}

-Here's a screenshot of the display in 10.1-

Known issue on 10.1:

https://www.BlackBerry.com/jira/browse/BBTEN-1247

Workaround solution, should work on 10.0 too:

WebView {
    ...
    preferredWidth: Infinity
    preferredHeight: Infinity
}

Tags: BlackBerry Developers

Similar Questions

  • webmapview on the bug of waterfalls-samples

    of https://github.com/blackberry/Cascades-Samples/tree/master/webmapview

    I had

    I dunno if everyone in the face of this bug?

    can someone help me solve I already try to use the default size on qml and even css it self but did not help

    I already create problem on github https://github.com/blackberry/Cascades-Samples/issues/113

    It seems that I am also facing the same issue - http://supportforums.blackberry.com/t5/Cascades-Development/webview-10-1-0-273-10-1-0-1435-showed-as...

  • How to report bugs of rendering CSS browser WebView/BB?

    I have an app that bypasses the normally difficult radio button style html5 by cutting the real radio inside a rectangle 0,0,0,0, then using the CSS: before Pseudo selector to create a substitute radio button image using nothing more than CSS attributes. It works perfectly on every single desktop browser, I tested against (Chrome, Firefox, IE, Opera), each Android browser, I've tried (Chrome, Firefox, Opera) and the same Android browsers running on my Z10 via Cobalt (Chrome, Firefox, Opera), but on the browser BB10 and WebView (so-called WebKit based as Chrome and Opera) does not support the CSS style the : Pseudo-selector update to show that when the Group of option buttons has focus.

    This is an example of what a couple of radio buttons by using this technique looks like when they have not developed in the...

    When option buttons have the focus, it should look like this...

    But as I said, on the browser BB10 or WebView even with the development of radio buttons always look like the first example. On all other browsers (except iOS/Safari, which proves defective as browsers BB10) favouring option buttons look like the second example.

    Anyone where I can tell you something like that?

    In the immortal words of Emily Littela... never mind. Since the BB10 and WebView browser seem to ignore the: pseudo-selector developed, I thought that it was a CSS rendering problem, but it is not. The idea that led me to a solution, is that the same problem occurs on iOS Safari too. A little Google search on the oddities of Safari has revealed the real cause.

    It turns out that even if Safari, as the browser BB10 and WebView, are Webkit based, he manipulates not the focus of the element like all the other funds or Android mobile WebKit browsers. Based on certain types of HTML elements is not automatically set focus to this element. One of the element types that it affects is the radio input element that I use. Some devs online are speculating that avoids unnecessary popups of the keyboard to the iOS screen by typing some controls on a form, but does not say Apple.

    The solution is quite simple, just set the focus in the OnClick of the radio input element explicitly. In this way, by tapping the control will force the browser to focus control and if necessary: focus CSS will be applied...

    myRadioButton.focus();
    

    I use jQuery so my generic code to manage all the radio buttons to a page looks like this...

    $('input[type="radio"').click( function() {
        $(this).focus();
    });
    

    It is clear that BlackBerry browser and WebView work in the same way as iOS Safari because this code sets things there also. I don't know if someone else is bickering with this problem when you target the WebView or BB10 browser, but I thought I would post the solution, just in case.

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

  • 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

  • _contentView.URL with webView

    Im trying to call my xml file _contentView.url

    WebView {
            id: myWebView
            url:_contentView.url
         }
    

    I'm sure that the wrong way because its not working how I would do that.

    IV by looking at the sample stampcollector and found something simliar

    ImageView {
                    imageSource: _contentView.URL
        }
    

    that makes sense but im trying to have _contentView.URL pull my google.com and others in.

    I got help and figured it out

     WebView {
                                    id: myWebView
                                    url: _contentView.html
    }
    

    and the xml string is

    html="http://google.com"/>
    
  • How to convert FLIR gray Image to a map of temperature in NI VBAI

    I worked with an infrared camera FLIR A315 and software VBAI of NEITHER.  I need determine the presence and continuity of a hot mastic foam which has been injected into the hollow bulb of a bead attached to 4 adjacent places that flow together inside the bulb of weatherstripping to form a continuous rubber scoured the filler plug.

    So far, I was able to trigger image acquisition in VBAI from a FLIR infrared camera monitoring the status bit an Allen-Bradley PLC.   Communication with the camera FLIR A315 is via the IMAQdx GigE driver.  However, I did not understand how to determine the temperatures of the gray scale images I get from the FLIR camera.  I wonder if someone could give me some advice on how to do it.

    I have attached a few images below to illustrate what I work with and to what extent I'm away.

    • iPhone_Photo.jpg - shows a photograph of the stripping section that the FLIR infrared camera is 'looking '.
    • FLIR_IR_Monitor.jpg - a screenshot of a FLIR Infrared Monitor utility that shows the temperatures measured at a number of points and areas (showing that it is possible)
    • NI_VBAI.jpg - part of my VBAI 2010 project that shows the image, I have acquired the FLIR A315 IR camera

    So, I am part of the path, but so far have not found a way to map the image of gray-scale that VBAI acquires the infrared camera FLIR in a heat map where I can determine the temperatures - and would be grateful for the help on how to do it.

    Kind regards

    Nick

    Hello

    Image provided by the FLIR camera are unsigned 16-bit.

    According to the temperature scale FLIR selected (10mK or 100mK), you have to divide by a factor of 10 or 100 to get the values of K. Do not select Exit radiometric.

    If your object is cold, the population of the histogram of the image will be on the left side of it and if the object is hot, the population of the histogram will be on the right side.

    If you want that your values of temperature in degrees Celsius, just add 273.15 Kelvin value.

    Then you can add a color palette in VBAI (iron FLIR is available)

    Hope this helps

  • HP 15-f039wm: Re: qualcomm-atheros wifi adapter does not work with windows 8

    Hello HP support.

    I have a HP 15-f039wm, product J8X12UA #ABA, running Windows 8.1.  I like it, but I thought I could improve it by upgrading to 8 GB, installation of a 240 GB SSD and move the 500 GB HARD disk to an external USB adapter.  So far, so good, so very jolly good.

    I also wanted to upgrade the Wi - Fi adapter to a faster power adapter with Bluetooth 4.0, but instead to get the AC7260 from Intel, I settled for a Qualcomm Atheros AR9485 with the Bluetooth BT3012 device, which belongs to a HP, I think.

    I shouldn't have paid.  Too late, I learned that the Atheros AR9485 has major compatibility problems.  Microsoft compatibility survey shows that some 530 speakers, 357 note as incompatible AR9485.

    This pair Bluetooth adapter and connects with my cell phone, but it remains connected for less than a minute before it disconnects.  It does not connect with something else I have.  It does not recognize my Bluetooth phone earpiece, and he recognizes that rarely my Bluetooth keyboard, with which it will pair but it never connects.

    The keyboard is a deal breaker - a must - have - and something really nice.  I tried the same Bluetooth keyboard sold by comb and Arteck jelly and a similar one by the EC technology, which has the top two rows of keys merged into one.  They connect immediately with an IPhone 4, but none of the three would be in contact with the BT3012 in my HP 15 - f039wm.

    Microsoft recommends the most recent drivers as a fix for incompatibility issues.  I downloaded the NIC drivers and card with Bluetooth Bluetooth drivers for the AR9485/BT3012 of http://www.station-drivers.com .  That updated the Qualcomm Bluetooth driver version 8.0.1.273, date from mid-2013, that came with the BT3012 (AR9485) Microsoft version of the driver 8.0.1.344 card, day 23/04/15.  Even still, it connects to my cell phone but nothing else.

    "Allow Windows to turn off this device to save power" is not checked for the adapter.  I also ran the 'netsh' command to clear the TCP/IP stack and reset the Winsock Catalog.  I have no intend to restore Windows to the factory; before that I would, I would get the Intel AC7260 more expensive card - that I probably do anyway, given the record of the incompatibility of the Qualcomm Atheros AR9485/BT3012.  I do not expect to change this folder, no matter what I do.

    But I'm open to suggestions.

    Thank you in advance for taking the time to investigate this problem.

    Hi @gospelmidi,

    Thank you for your inquiry.

    I take that you have swapped the hard drive and replaced the original card wireless and Bluetooth with the Qualcomm Atheros AR9485 with the Bluetooth BT3012 device and cannot associate with something other than your cell phone.  You tried to reset the TCP/IP stack, but there was no change.

    Did you run HP Support Assistant to ensure you have all the updates from HP?

    Have you tried to run the troubleshooter in Windows?

    Alternatively, you can try the following steps.

    Step 1. Go to Device Manager
    Step 2. Right click on "Bluetooth device" you want
    Step 3. Select "update driver software... »
    Step 4. Choose "Browse my computer for driver software".
    Step 5. Choose "Let Me pick from a list of drivers for devices on my computer.
    Step 6. Select "Ports (COM & LPT)"
    Step 7. Select "Microsoft" to the list of "manufacturers".
    Step 8. Finally select "Standard series via a Bluetooth connection.

    If you are unable to connect to a Bluetooth device, try the following:

    Step 1. Search for 'Change device' in the start menu in Windows 8.
    Step 2. Click on where it says change device installation settings.
    Step 3. Select No, let me choose what to do option.
    Step 4. Check the automatically get the device app option
    Step 5. Click on save changes to save the settings that you select

    So, you can try this

    Step 1: Go to RUN (Windows Logo + R) and type "services.msc" and Enter
    Step 2: Now find 'Bluetooth Support Service' and double click it
    Step 3: Now click on the Log on tab and type "Local Service" without the quotes
    Step 4. Click on "account".
    Step 5: Now remove any authorization of passwords the password field blank
    Step 6: Below the upper left title should be a hyperlink 'Start' click

    If the problem here is a link to HP 15 Notebook PC Maintenance and Service of Guide for your laptop.  Please note Chapter 3, page 17, section 17 for recommended replacement cards.

    To say thank you for answering, please click on the thumbs up icon below.

    If this fixes your problems please let know in choosing the solution to other people.

    Good luck!

  • Lenovo G555 OKR Win 7 Home Premium

    Ugh! I came here and saw there were 200 + pages of topics. I'm sorry if mine is already validated and has an answer, but I ask myself in a hospital bed need to use OKR and cannot understand it. I won't go through all the pages to see if my are answered so bear with me. I have no documentation with me (it's at home for obvious reasons). Recently, I have this computer and have not yet created backups "file of users. The only backup here is everything back to how it was if I had just bought it and was first put on brand new.

    IF I ABSOLUTELY have TO, I could lose my bookmarks in firefox (or I could just the zip file and send them an email to me - I use Live Mail so I'm not worried about the deletion and lose my emails). But I wouldn't lose my documents, videos and what-not. My other software, I installed from the factory-fresh install when I bought the computer is not much and I can actually just go to some sites and reinstall things, No biggy.

    What I prefer is to back up all my personal files, so I don't have to re-download anything and have it take 1 million years to reinstall everything. In 'My Computer', I saw the C: partition, the partition D: (Lenovo) who had the OKR related files and I guess that the secret files to reinstall the original image. I have Windows, the value do not hide what whatsoever from me. I also see a MS Office Starter 10 q score: who is protected, but didn't seem to do anything when you double-click it except give me an error message that I am not authorized to access. Then there's the DVD Burner F: and below, there is a "Norton Backup" type icon that looks like a hard drive, but when you double click on that, it shows just 3 icons more: 1) backups of the system by default C: partition, 2) the partition D: Lenovo backups and backups DVD Burner F:... By double clicking on anyone of them showed that the it is that anything backed up towards them.

    If I close and press the OKR which looks like a symbol of u-Turn of orange color, it brings me to the OKR options screen but since I have no backups created by the user, the only option that it will really allow me to choose is exit and let Windows load just as it does now and continue to use the computer , or reset the computer to the original image and lose everything...

    How the hell do a user-created backup image? I went to C:\Program Files\Lenovo\OneKey App\OneKey Recovery\Language\Enu\ and there was an overview of the OKR program, but nothing to really say how to create an image backup created by the user, the .htm files. Just that you are going to kick you if you create a return to the top of your data first and run the OKR to restore the original image. Not very useful. It would be nice if in fact, he crossed and detailed how the hell do!

    I want to thank you all for your attempts to help me. I went to uninstall the existing installation of OKR and re - download the installation file, so I can install a new copy from the links provided in this thread. Unfortunately, I was with a WiFi very slow at the hospital I was staying in and after about 20-30 of 273 MB downloaded, it seems the download has completed. I finally got so fed up with it, I used a downloader that supports recovery and even in this case is the same trouble. Finally on download seventeenth attempt, I got it completely downloaded. Once again, since I'm on a slow connection, it took about 2-3 days with all these upheavals, but I got it. Then when I installed it, it's the same thing. GRR! Then, so I decided to save all my important files on a DVD and I just shut down the computer and supported the OKR button and allowed him to recover the original factory installed image. Now, Win 7 Home Premium desktop screen when you press the OKR, it gives you the options to create images of backup or restore backups I have created or install again the original factory image. It's a pain in the neck, but I got it working properly, finally. Yet once, I want to thank you all for trying to help, and you can now consider this topic resolved.

  • Setting Web display over the entire height of the device

    Hello

    Recently, I submitted one of my BlackBerry 10 applications to built for BlackBerry, but that it must be approved, I must have the webView fill the entire page. The illustration below shows the Web view covers only about half of the page because there is not enough of content to fill an entire page.

    Here is the code that I use for my webView:

    Container {
            layout: DockLayout {
    
            }
            verticalAlignment: VerticalAlignment.Fill
            horizontalAlignment: HorizontalAlignment.Fill
            background: Color.Black
            ScrollView {
                id: scrollView1
                scrollViewProperties.pinchToZoomEnabled: true
                scrollViewProperties.scrollMode: ScrollMode.Vertical
                verticalAlignment: VerticalAlignment.Fill
                horizontalAlignment: HorizontalAlignment.Fill
                Container {
                    layout: StackLayout {
                        orientation: LayoutOrientation.TopToBottom
                    }
                    verticalAlignment: VerticalAlignment.Fill
                    horizontalAlignment: HorizontalAlignment.Fill
                    background: Color.Black
                    WebView {
                        id: webView1
                        onLoadingChanged: {
                            if (loadRequest.status == WebLoadStatus.Started) {
    
                            } else if (loadRequest.status == WebLoadStatus.Succeeded) {
                                webLoading.stop()
                            } else if (loadRequest.status == WebLoadStatus.Failed) {
    
                            }
                        }
                        // WebView settings, initial scaling and width used by the WebView when displaying its content.
                        settings.viewport: {
                            "width": "device-width",
                            "initial-scale": 1.0
                        }
                        onMinContentScaleChanged: {
                            // Update the scroll view properties to match the content scale
                            // given by the WebView.
                            scrollView1.scrollViewProperties.minContentScale = minContentScale;
    
                            // Let's show the entire page to start with.
                            scrollView1.zoomToPoint(0, 0, minContentScale, ScrollAnimation.None)
                        }
    
                        onMaxContentScaleChanged: {
                            // Update the scroll view properties to match the content scale
                            // given by the WebView.
                            scrollView1.scrollViewProperties.maxContentScale = maxContentScale;
                        }
                        verticalAlignment: VerticalAlignment.Fill
                        horizontalAlignment: HorizontalAlignment.Fill
                    }
                    Divider {
                        id: infoTextDivider
                        visible: false
    
                    }
                    Container {
                        visible: false
                        id: infoTextContainer
    
                        verticalAlignment: VerticalAlignment.Center
                        horizontalAlignment: HorizontalAlignment.Center
                        Label {
                            multiline: true
                            id: infoText
                            textStyle.textAlign: TextAlign.Center
                        }
                    }
                }
            }
            Container {
                id: loadMask
                background: Color.Black
                layout: DockLayout {
    
                }
                verticalAlignment: VerticalAlignment.Fill
                horizontalAlignment: HorizontalAlignment.Fill
                Container {
                    leftPadding: 10.0
                    rightPadding: 10.0
                    topPadding: 10.0
                    bottomPadding: 10.0
                    horizontalAlignment: HorizontalAlignment.Center
                    verticalAlignment: VerticalAlignment.Center
                    ActivityIndicator {
                        id: webLoading
                        preferredHeight: 200.0
                        preferredWidth: 200.0
                        horizontalAlignment: HorizontalAlignment.Center
                        onStarted: {
                            loadMask.setVisible(true)
                        }
                        onStopping: {
                            loadMask.setVisible(false)
                        }
                    }
                    Label {
                        text: "Loading " + titleBar.title + "..."
                        horizontalAlignment: HorizontalAlignment.Center
                        textStyle.fontSize: FontSize.Large
                        textStyle.fontWeight: FontWeight.W100
                        textStyle.color: Color.White
                    }
                }
            }
        }
    

    If any help with what I need to add in order to show Web to fill the entire page would be great!

    Thanks in advance

    Web layout:

    set:

    preferredHeight: 1280
    preferredWidth: 768
    maxHieght: 1280
    maxWidth: 768
    minHeight: 720
    minWidth: 720
    
  • Application only shows the initialization, please wait

    I converted successfully (using the: https://bdsc.webapps.blackberry.com/android/bpaa/) and deployed in VMWare Simulator (Blackberry Playbook 2.0.0.6147) an application very simple andoird.  The application simply loads a page of local Web inside a webview on Android.  All features are built in a no other pots or even a permit is necessary.  It deploys without problem and displays the icon, but when you click top right shows the BB logo with a flash of "initialisation initialization in progress, please wait".  Logo continues to show that it treats but he never goes one further.  At this point, I am at a loss to discover why or even to get any type of messages to find out what is happening to debugging.

    What am I missing, it cannot be that far right?

    I was wondering if you guys have on the thing of carrots 2 in VMWare? I don't know if this could be a reason, but maybe your applications are time given that the emulator is slow.

  • To access local files of QNXStageWebView

    Hello community,

    I need help in the understanding of the capabilities of webkit playbook.

    My AIR application creates images and save them in File.applicationStorageDirectory or File.applicationDirectory and QNXStageWebView must take these images and show.

    QNXStageWebView displays some html with javascript that takes pictures of the url I give to him.

    And for now webview can show that stored pictures in the folder root CBC in my project as "src/appicon.png" and I saw this image in this way "local:///appicon.png" Web view, otherwise, it produces an error such as the failed to load Document [NetworkErrorEvent type = "error" bubbles = false cancelable = false eventPhase = 2 text = "could not read a file file://" errorID =-10037 url=file:///accounts/1000/appdata/com.xxx.PRPlaybook.debug.testDev_ybook_debug63d6f35d/app/air/142676836_2_0_0.png.]

    Please can someone explain, where I can store the images to display in Web mode?

    Thank you.

    Hello. Laptop more, I saved an image in the same directory as the HTML I was working. Say that my .html file is in File.documents I put that image there too and then he referred to simply as "appicon.png" without the file:///blahbblahblah.

  • BlackBerry Z10 display on lock screen wallpaper

    A week ago, I noticed that my Z10 display the BB_Blue.jpgp wallpaper on the lock screen. I saw him a few days and then he stopped.

    I thought it was odd because I had not chosen a background of screen on the device at this point, so I thought it could be related to the OS update to 10.1.0.273 (although this has happened a few weeks after the update).

    But I liked the look!  He relieved the monotony of the dark background.

    Then I put the wallpaper at BB_Blue.jpgp and it works on all screens except when the device is locked.

    Anyone know how to set the background image to display on the lock screen?

    The solution came to me after I realized what was different about my setup.

    I had activated the Parental control as a means of screening telemarketer calls. With only active PC calls from numbers in my contacts would cause the phone to ring, all other calls would go directly to the answer.

    What I realized, is that certain settings applied while Parental control is activated, applies only to this mode. My idea was the fact that I had arranged my icons go, and when I disabled it briefly Parental control they were back to the standard display.

    I tested this by assigning the wallpaper for the purple standard view, then activated Parental control set the wallpaper in blue. When you navigate in Parental control mode, the wallpaper is blue, but when the screen freezes the purple wallpaper is displayed.

    If the bug (or feature not documented), it's that the wallpaper you choose with active Parental control is not used for the lock screen. The locked screen uses the wallpaper to the standard display. In my original problem, because I didn't put a wallpaper for the standard display, the locked screen showed that the dark background.

  • ListView recycling

    Hello!

    ListView seems to have a recycling system when scrolling

    There any drawback, for example, if I have a checkbox on a cell, it is sometimes already checked while I specifically put "checked = false" in the QML.

    So, this means that when webview re-use an old cell, it sets all data that depends on the DataModel, but not the default values.

    Is this true of the assumption?

    Have we not a signal or a workaround to restore the default settings of the cell?

    Thank you

    Finally, I created the checkbox to make it to bind to the ListItem, even if it has no meaning to the data.

  • Question of layout on VBox with different content (bug or not?)

    I don't know if the following behavior is a bug, or scheduled. At least the behavior has changed since 2.2 to the last beta 8.

    I have VBox container. Inside is a ListView and a BorderPane. The content in the center of the BorderPane can be changed between a text box and a WebView. When that happens, the height of the ListView changes. (No additional constraints have been put on one of the nodes).

    I'm not enough of an expert layout of course what happens here. The desired behavior would be that ListView (or across the top of the VBox) has a constant size, does not matter what is in the rest of the VBox. If the observed behavior is intended, how can I get the desired behavior?

    Complete code below.

    package jbugs;
    
    import javafx.application.Application;
    import javafx.stage.Stage;
    import javafx.scene.layout.BorderPane;
    import javafx.scene.control.Button;
    import javafx.event.EventHandler;
    import javafx.event.ActionEvent;
    import javafx.scene.control.ToolBar;
    import javafx.scene.layout.VBox;
    import javafx.scene.control.ListView;
    import javafx.scene.control.TextArea;
    import javafx.scene.web.WebView;
    import javafx.scene.Scene;
    
    public class WebViewLayoutBug extends Application {
    
      public void start(Stage stage) {
    
        BorderPane root = new BorderPane();
    
        Button text = new Button("TextArea");
    
        Button web = new Button("WebView");
        ToolBar toolbar = new ToolBar(text, web);
    
        VBox vb = new VBox();
    
        ListView<String> lv = new ListView<String>();
       
        lv.getItems().addAll("foo", "bar");
    
        final BorderPane bp = new BorderPane();
    
        vb.getChildren().addAll(lv, bp);
    
        final TextArea textArea = new TextArea();
        final WebView webView = new WebView();
    
        text.setOnAction(new EventHandler<ActionEvent>() {
          public void handle(ActionEvent e) {
            bp.setCenter(textArea);
          }
        });
    
        web.setOnAction(new EventHandler<ActionEvent>() {
          public void handle(ActionEvent e) {
            bp.setCenter(webView);
          }
        });
    
        root.setTop(toolbar);
    
        root.setCenter(vb);
       
        stage.setScene(new Scene(root, 800, 600));
        stage.show();
      }
    
    }
    
    

    This has exactly the same for me in 1.7.0_40 JDK and JDK 1.8.0 b109.

    The desired behavior would be that ListView (or across the top of the VBox) has a constant size, does not matter what is in the rest of the VBox. If the observed behavior is intended, how can I get the desired behavior?

        lv.setMinHeight(Control.USE_PREF_SIZE);
        lv.setMaxHeight(Control.USE_PREF_SIZE);
    

Maybe you are looking for