browserField.executeScript

Hello

I'm stuck with a question on the addition of a browserFieldListener. I have a native application BlackBerry accessing a web application using the browser. I have a JavaScript block in a specific page. I want to use browserField.executeScript ("my javascript in a JSP page") and check the returned Boolean value when I ask for each page. So I replace the documentLoaded method and add the inside executeScript method. However, she always throws IllegalStateException when browserField.executeScript. After I go through the RIM API, I found it refers to the exception as " IllegalStateException -this exception is thrown if this method invoked before this BrowserField document has been created." This event is communicated via the BrowserFieldListener.documentCreated () method. "Someone has suggestions or comments here, please? Thank you very much.

I finally understand this problem. He won't do the method of excuteScript in documentLoaded() of BrowserFieldListener since the scripts contained in the document cannot be invoked until the document is loaded. I think it makes sense. So if you want to do stuff like read the DOM to call javascript from your document, make sure that the action happens after all the document is loaded. The original intent of my code is kind of like: use the browser to open a web page, check some flag from this page, generate a menu browser dynamically customized for this indicator. So now, I put all this reading document action in makeMenu and this method would make sure all the action happening after the page loads.

Tags: BlackBerry Developers

Similar Questions

  • app crashing using javascript SDK 6.0 browserfield2

    Hi all!

    I have my app allmost crashed every time I call the javascript in browserfield to scroll the text in there. Sometimes this only works when javascript is called the first time.

    SDK 6.0

    device also has 6.0 sdk

    class MyBrowserFieldView extends screen implements {RenderingApplication}

    RenderingSession renderingSession;

    BrowserField browserField;

    VerticalFieldManager verticalFieldManager;

    public MyBrowserFieldView() {}

    ToolBarMenuButton.AddMenuItem (New MenuItem ("show", 100, 1)})
    public void run() {}
    browserField.executeScript ("document.body.scrollTop ='" + position + ""; "");
    }
    });

    renderingSession = RenderingSession.getNewInstance ();

    renderingSession.getRenderingOptions () .setProperty (RenderingOptions.CORE_OPTIONS_GUID,
    (RenderingOptions.JAVASCRIPT_ENABLED, true);
    renderingSession.getRenderingOptions () .setProperty (RenderingOptions.CORE_OPTIONS_GUID,
    RenderingOptions.CSS_MEDIA_TYPE, "screen");
    renderingSession.getRenderingOptions () .setProperty (RenderingOptions.CORE_OPTIONS_GUID,
    (RenderingOptions.ENABLE_CSS, true);

    browserField = new BrowserField();

    verticalFieldManager = new MyManager();

    try {}
    browserField.requestContent (HtmlFileName);
    verticalFieldManager.add (browserField);
    Add (verticalFieldManager);
    } catch (Exception ex) {}
    ex.printStackTrace ();
    }

    }

    }

    So, what can be wrong?

    Thanks for any help!

    Yes, using another thread has helped. Thanks again!

  • BlackBerry JRE 5.0.0 BrowserField has no ScriptEngine

    Hello

    Ive got a BrowserField:

    BrowserFieldConfig config = new BrowserFieldConfig();
    config.setProperty (BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
    This.Browser = new BrowserField (config);

    which returns the null value on:

    this.browser.getScriptEngine ();

    Prevents me to run scripts from the code Java, because browser.executeScript ("somejavascript"); throws IllegalStateException which States that there is no such thing as the ScriptEngine. Which is kinda funny, because when I load JQuery its able to compile the script and the BrowserFieldDebugger tell me, that JSON is not defined. Which is exactly why I want to run a script inside the Java code from in the first place. Well, I need to call javascript functions later as well so I would have needed this feature in one way or another. BTW. : browser.displayContent (' javascript : somejavascript ", someurl" ") seems to generate a kind of error page.

    Test on a 9700, build against BlackBerry JRE 5.0.0

    ID like to have this app running next Thursday, a quick (and useful) answer would be appreciated (if you need more information, ask away).

    Thanks in advance.

    Sorry not an area of expertise, but I have some thoughts.

    Copy the following code

    invokeLater (new Runnable() {public void run() {}

    thing to run

    (}, 500, flag);

    you continue to repeat if the flag is true initially (it is not re-evaluated).  So I think you really want to code something like:

    Runnable testScriptEngine = new Runnable() {}

    public void run() {}

    ScriptEngine scriptEngine = mdBrowserField.getScriptEngine ();

    If (scriptEngine == null) {}

    invokeLater (this, 500, false);

    } else {}

    Dialog.Alert ("found Script engine");

    }

    };

    invokeLater (testScriptEngine, 500, false);

    If I was looking for something that could be triggered when the browserField 'worked', I would look at the method documentLoaded() of the BrowserField listener:

    http://supportforums.BlackBerry.com/T5/Java-development/BrowserField-sample-code-using-the-BrowserFi...

    I'm guessing it is significant above using a Script engine, so I can see a reason to not create a Script engine up until you need it - so it does not surprise me that one is not created in BrowserField instantiation.

  • Support HTML5 history component BrowserField?

    Hi all

    I use BrowserField component to display external views in my HTML application using AJAX technology in navigation. I've implemented HTML5 history (http://www.w3.org/TR/html5/history.html) in order to manage requests for return. I know that the BlackBerry native browser supports HTML5 history because my back implementation works fine when I use the native browser directly to test my Web site.

    In my BlackBerry app I implement the "back" button to call browserField.back () like this:

    protected boolean keyCharUnhandled(char key, int status, int time) {
            switch (key) {
            case Characters.ESCAPE:
                field.back();
                return true;
            }
            return super.keyCharUnhandled(key, status, time);
        }
    

    This rear implementation does not work.

    I assumed that field.back () is not compatible with HTML5 history because the BrowserFieldHistory component only stores the queries of navigation and not AJAX queries (is that a request for the resource recovers in the background).

    Is there a solution to implement AJAX applications back to BrowserField?

    Thank you!

    The solution is:

    protected boolean keyCharUnhandled(char key, int status, int time) {
            switch (key) {
            case Characters.ESCAPE:
                field.executeScript("window.history.back()");
                return true;
            }
            return super.keyCharUnhandled(key, status, time);
        }
    
  • Browserfield generates the internal server error

    Hello

    I've implemented an example usage of the guide on this link and its working quite right, but then I saw something. If I click on a link within the browserfield to a non html resource, say mp3 for example http://site.com/file.mp3 or the server redirects or a survey non - response to the browserfield html, I get an internal server error.

    I tried the same in the native browser and everything works fine.

    So I think, it is possible to intercept a request when the user clicks on a link and open the native browser instead when a particular url scheme is detected?

    In addition, im having trouble changing the user-agent the browserfield, here is what Ive wrote

    ===========

    BrowserFieldConfig config = new BrowserFieldConfig();
    config.setProperty (BrowserFieldConfig.VIEWPORT_WIDTH, New Integer (Display.getWidth ()));
    config.setProperty (BrowserFieldConfig.INITIAL_SCALE, new Float (1.0));
    config.setProperty (BrowserFieldConfig.USER_SCALABLE, Boolean.FALSE);
    config.setProperty (BrowserFieldConfig.ENABLE_COOKIES, Boolean.TRUE);
    config.setProperty (BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
    config.setProperty (BrowserFieldConfig.NAVIGATION_MODE, BrowserFieldConfig.NAVIGATION_MODE_POINTER);
    config.setProperty (BrowserFieldConfig.USER_AGENT, "MyCustomUAString");

    BrowserField browserField = new BrowserField (config);

    ==============

    Also, I would also like to be able to hide the Progress bar when the browserfield does not load any page, so that it shows only when it is needed (IE when a link is clicked)

    Thank you

    A code example.  If you can't understand what it is supposed to do, please ask. Put shaped went squiffy, sorry about that.

    BTW, I really struggle to test BrowserField treatment on simulators, they seem flaky and sometimes I can't debug.  The one I usually use is actually a 5.0 OS simulator 9300.

    / public final class BrowserFieldScreen extends screen

    implements BrowserFieldConnectionManager {}

    Private BrowserField _bf2;

    Private BrowserFieldConnectionManager standardBFConnectionManager;

    public BrowserFieldScreen() {}

    Super();

    _bf2 = new BrowserField();

    This.Add (_bf2);

    our ConnectinManager hook

    standardBFConnectionManager = _bf2.getConnectionManager ();

    BrowserFieldConfig bfconfig = _bf2.getConfig ();

    bfconfig.setProperty (BrowserFieldConfig.CONNECTION_MANAGER, this);

    _bf2.requestContent ("http://www.google.co.uk");

    }

    Implementation of the BrowserFieldConnectionManager

    public InputConnection makeRequest (application BrowserFieldRequest) {}

    String requestURL = request.getURL ();

    System.out.println ("request:" + requestURL);

    Boolean toBrowser = false;

    If {(requestURL.endsWith ("mp3"))

    toBrowser = true;

    }

    If (requestURL.indexOf ("bbc.co.uk") > 0) {}

    toBrowser = true;

    }

    If {(toBrowser)

    Private browserSess = Browser.getDefaultSession ();

    If (! requestURL.startsWith ("http")) {}

    requestURL = "http://" + requestURL;

    }

    browserSess.displayPage (requestURL);

    String codehtmla =

    "" +

    "


    View in browser

    " +

    "";

    return new BrowserFieldResponse (requestURL, htmlToDisplay.getBytes (), HttpProtocolConstants.CONTENT_TYPE_TEXT_HTML);

    }

    try {}

    Return standardBFConnectionManager.makeRequest (request);

    } catch (Exception e) {}

    System.out.println ("Exception:" + try ());

    }

    String codehtmla =

    "" +

    "


    Exception

    " +

    "";

    return new BrowserFieldResponse (requestURL, htmlToDisplay.getBytes (), HttpProtocolConstants.CONTENT_TYPE_TEXT_HTML);

    }

    BackMenuItem MenuItem = new MenuItem ("Back", 110, 10) {}

    public void run() {}

    _bf2. Back();

    }

    };

    ForwardMenuItem MenuItem = new MenuItem {("Forward", 110, 10)

    public void run() {}

    _bf2. Forward();

    }

    };

    protected void makeMenu (menu Menu, for example int) {}

    If (_bf2.getHistory () .canGoBack ()) {}

    menu. Add (backMenuItem);

    menu.setDefault (backMenuItem);

    }

    If (_bf2.getHistory () .canGoForward ()) {}

    menu. Add (forwardMenuItem);

    menu.setDefault (forwardMenuItem);

    }

    }

    }

  • Why BrowserField demo does not use BrowserField?

    I had some problems getting the BrowserField object to display all images on a page. When you search the formus, it was suggested to use the BrowserFieldDemo included in JDE for example. I tried and it works, but the back button does not work and you can not click on one of the links. Then I discovered that it does not actually use a BrowserField object as in

    net.rim.device.api.browser.field2.BrowserField
    

    Does anyone know how to make the browserField to work... WITH a functional back button and no image broken?

    I'd appreciate all point in the right direction.

    In fact, I realized that BrowserField demo uses OS 4.0 components while the BrowserField object is only OS 5.

  • BrowserField BlackBerry: How to get the value of the existing cookie

    Hello

    First of all, I want to let you know that I have to create a Web page at www.mydomain.com/whois.html

    then I put a cookie with javascript named 'user name = adrian' on this page

    In my Aplication BB I declare browserfield to load "whois.html".

    Here is the code

    Import net.rim.device.api.browser.field2.BrowserFieldCookieManager;
    Import net.rim.device.api.browser.field2.BrowserFieldConfig;
    Import net.rim.device.api.browser.field2.BrowserField;
    Import net.rim.device.api.ui.component.Dialog;
    Import net.rim.device.api.ui.container.MainScreen;

    / public final class BrowserDemoScreen extends screen
    {
    public BrowserDemoScreen()
    {
    setTitle ("BrowserFieldScreen");

    BrowserFieldConfig config = new BrowserFieldConfig();
    config.setProperty (BrowserFieldConfig.USER_AGENT, ' MyApplication 1.0 "');
    BrowserField _bf2 = new BrowserField (config);

    _bf2.requestContent ("http://www.mydomain.com/whois.html");
    Cookie String = _bf2.getCookieManager ().getCookie("__http://www.mydomain.com__").valueOf ("username");

    Dialog.Alert ("Cookie1 value =" + cookie);
    Add (_bf2);
    }
    }

    and if I run the code it does not get the "username" value, what's wrong with my code? Thank you

    Aaah... I have the cookie Manager to mydomain.com/whois.html instead of mydomain.com it prints all the information in "Add (new RichTextField (existingCookie));"

  • Browserfield, with cookies

    If anyone could be kind enough to download an implementation of the browserfield with cookies enabled. I have a little trouble with it.

    Thanks in advance

    You can find an example here:

    Enable cookies under BrowserField

    http://supportforums.BlackBerry.com/T5/Java-development/enable-cookies-in-BrowserField/Ta-p/445032

  • The images are not display with html content in browserfield

    Hi friends, I am display local html content in the browserfield. It is are display fine but pictures are not display is also local resources stored in the project. I use jde 5.0. Whats to display pictures.

    After so much, I solved it and the images are displayed correctly. I had the habit now of base64 class and image data are passed to the base64 format.

  • BlackBerry BrowserField: The Application crashes while downloading.

    Hi, I use browserfield2 in my application to load Web pages, now the problem is the application is always unexpected crashes while downloading, no problem to download the file with size < 500kb="" but="" if="" the="" file="" has=""> = 1 mb size it will crash, the strange thing is I can get download process finished with the construction in the Blackberry browser, hmm... any guy of solution? Thanks in advance

    Here is the code

    public BrowserDemoScreen()

    {
    setTitle ("BrowserFieldScreen");
    BrowserFieldConfig config = new BrowserFieldConfig();
    config.setProperty (BrowserFieldConfig.USER_AGENT, ' MyApplication 1.0 "');
    BrowserField _bf2 = new BrowserField (config);
            
    _bf2 = new BrowserField();
    _bf2.requestContent ("http://mydomain/upload.php");
    Add (_bf2);
    }

    HTML form





    php code

    <>
    $uploaddir = '. / uploads /';
    $filename = $_FILES ['uploadfile'] ['name'];
    $filesize = $_FILES ['uploadfile'] ['size'];
    $filetemp = $_FILES ['uploadfile'] ['tmp_name'];
    $file = $uploaddir. baseName($_files['uploadfile']['name']);

    echo $filename. »
    ";
    echo $filesize. »
    ";
    echo $filetemp;

    If (move_uploaded_file ($filetemp, $file))
    {
    echo "success."
    }
    on the other
    {
    echo "error";
    }
    ?>

    as you can see that I did not use any javascript on this page, it's pure php, which makes the BrowserField crash?

    The solution is:

    public class resignation against UiApplication

    {

    public Resignation()

    {

    If (filesize > = 1 MB)

    Dialog.Alert ("use your personal desktop computer to download selected file!");

    on the other

    Dialog.Alert ("good boy, now, you understand that we have maximum file download size limit");

    Close();

    }

    }

  • BrowserField fails to open a local resource within the PIMListListener

    Hello

    I have a problem with the opening of the resources of regional settings through BrowserField inside the PIMListListener implementation.

    My local resources is an html element placed on ROOT_PROJECT/res/test.html

    I opened it to principal in UIApplication and it works fine. Howevwe, I instantiated my PIMListListener which manages caledar event, when my PIMListListener is awake performed copy the following code:

    UiApplication.getUiApplication () .pushScreen (new TestView());

    Here he code of the manufacturer of the display:

    _Config BrowserFieldConfig = new BrowserFieldConfig ();
    BrowserField _bf2 = new BrowserField (_config);
    Add (_bf2);
    _bf2.requestContent("local:///test.html");

    After the insertion of the PIMListListener calendar events call display class (screen), but the result is an empty view with this error message:

    ...

    Applicant content of error for:

    local:///test.html

    Error: resource does not exist

    ....

    the same operation done very well in the principal works of the application!

    Any ideas?

    Thank you

    You must requestForeground in your app - that's what I meant by putting you in the foreground:

    requestForeground();

    I think need you immediately after the pushScreen (_screen);

    I see no reason why you need a Thread.sleep and I urge you to remove it.  At this point in your application that you run on the thread of events, so a sleep blocks.

  • BrowserField encoding problem

    Hello! Please, help me! I spent almost all day, but have had no success. My BrouserField is showing '? ' characters instead of the non-English characters.
    I need to get the Ribbon XML, analyze and display in the BrowserFiled.
    I use these classes:

    (1) WaitScreen - PopupScreen from the example of knowledge base

    public class WaitScreen extends PopupScreen {
    
        private LabelField _ourLabelField = null;
    
        private WaitScreen(String text) {
            super(new HorizontalFieldManager());
            VerticalFieldManager _vfm = new VerticalFieldManager();
            _ourLabelField = new LabelField(text, Field.FIELD_HCENTER);
            _vfm.add(_ourLabelField);
            this.add(_vfm);
            this.setBackground(BackgroundFactory.createSolidTransparentBackground(Color.BLACK, 225));
        }
    
        public static void showScreenAndWait(final Runnable runThis, String text) {
            final WaitScreen thisScreen = new WaitScreen(text);
            Thread threadToRun = new Thread() {
                public void run() {
                    // First, Waintdisplay this screen
                    UiApplication.getUiApplication().invokeLater(new Runnable() {
                        public void run() {
                            UiApplication.getUiApplication().pushScreen(thisScreen);
                        }
                    });
                    // Now run the code that must be executed in the Background
                    try {
                        runThis.run();
                    } catch (Throwable t) {
                        t.printStackTrace();
                        throw new RuntimeException("Exception detected while waiting: " + t.toString());
                    }
                    // Now dismiss this screen
                    UiApplication.getUiApplication().invokeLater(new Runnable() {
                        public void run() {
                            UiApplication.getUiApplication().popScreen(thisScreen);
                        }
                    });
                }
            };
            threadToRun.start();
        }
    }
    

    (2) RSSHandler - class auxiliary for analysis

    public class RSSHandler extends DefaultHandler {
        boolean isItem = false;
    
        boolean isTitle = false;
        boolean isLink = false;
        boolean isDescription = false;
        boolean isPubDate = false;
        boolean isGuid = false;
    
        public String[] title = new String[] {};
        public String[] link = new String[] {};
        public String[] description = new String[] {};
        public String[] pubDate = new String[] {};
        public String[] guid = new String[] {};
        String value = "";
    
        public void startElement(String uri, String localName, String name,
                Attributes attributes) throws SAXException {
            if (!isItem) {
                if (name.equalsIgnoreCase("item"))
                    isItem = true;
            } else {
                if (name.equalsIgnoreCase("title"))
                    isTitle = true;
                if (name.equalsIgnoreCase("link"))
                    isLink = true;
                if (name.equalsIgnoreCase("description"))
                    isDescription = true;
                if (name.equalsIgnoreCase("pubDate"))
                    isPubDate = true;
                if (name.equalsIgnoreCase("guid"))
                    isGuid = true;
            }
        }
    
        public void characters(char[] ch, int start, int length)
                throws SAXException {
            if (isTitle || isLink || isDescription || isPubDate || isGuid)
                value = value.concat(new String(ch, start, length));
        }
    
        public void endElement(String uri, String localName, String name)
                throws SAXException {
            if (isItem && name.equalsIgnoreCase("item"))
                isItem = false;
            if (isTitle && name.equalsIgnoreCase("title")) {
                isTitle = false;
                Arrays.add(title, value);
                value = "";
            }
            if (isLink && name.equalsIgnoreCase("link")) {
                isLink = false;
                Arrays.add(link, value);
                value = "";
            }
            if (isDescription && name.equalsIgnoreCase("description")) {
                isDescription = false;
                Arrays.add(description, value);
                value = "";
            }
            if (isPubDate && name.equalsIgnoreCase("pubDate")) {
                isPubDate = false;
                Arrays.add(pubDate, value);
                value = "";
            }
            if (isGuid && name.equalsIgnoreCase("guid")) {
                isGuid = false;
                Arrays.add(guid, value);
                value = "";
            }
        }
    }
    

    (3) CaptionScreen (screen with BrowserField I need to show the result of the XML parsing)

    public class CaptionScreen extends MyMainScreen
    {
        private BrowserField _browserField;
    
        public CaptionScreen(Application app, String section)
        {
             //....
             GetArticles getArticles = new GetArticles("http://" + _urlWithArticles, _browserField);
             WaitScreen.showScreenAndWait(getArticles, "LOADING");
        }
    
        static class GetArticles implements Runnable {
            String _url = null;
            BrowserField _resultBrowser;
    
            public GetArticles(String urlToGet, BrowserField resultBrowser) {
                this._url = urlToGet;
                this._resultBrowser = resultBrowser;
            }
    
            public void run() {
                // Try to download new articles and parse the answer
                HttpConnection httpConn = null;
                InputStream is = null;
                RSSHandler rssHandler = new RSSHandler();
    
                try {
                    httpConn = GetConnection(_url);
    
                    is = httpConn.openInputStream();
                    try {
                        SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
                        parser.parse(is, rssHandler);
                    }
                    catch (ParserConfigurationException e) {
                        e.printStackTrace();
                    }
                    catch (SAXException e) {
                        e.printStackTrace();
                    }
                    catch (IOException e) {
                        e.printStackTrace();
                    }
                } catch (IOException ioe) {
                } catch (Exception e) {
                } finally {
                    try {
                        if ( httpConn != null ) {
                            httpConn.close();
                        }
                    } catch (Exception e) {
                    }
                    httpConn = null;
                }
    
                final String htmlArticles = generateHtml(rssHandler);
                UiApplication.getUiApplication().invokeLater(new Runnable() {
                    public void run() {
                        _resultBrowser.displayContent(htmlArticles, "");
                    }
                });
            }        
    
            // Method for html generation to showing in BrowserField
            private String generateHtml(RSSHandler rssHandler) {
                String result = "";
                if(rssHandler == null) {
                    return result;
                }
                result += "News";
    
                for(int i = 0; i < rssHandler.title.length; i++) {
                    result += rssHandler.title[i] + "
    " + "LINK
    " + rssHandler.description[i] + " "; } result += ""; return result; } private HttpConnection GetConnection(String _url) throws IOException { if (DeviceInfo.isSimulator()) { _url = _url + ";deviceSide=true"; } MyConnFact _myConnFact = new MyConnFact(); HttpConnection _httpConn = null; ConnectionDescriptor _connDesc = _myConnFact.getConnection(_url); if (_connDesc != null) { _httpConn = (HttpConnection)_connDesc.getConnection(); } return _httpConn; } } }

    It works very well (showing WaitScreeen, data download), but all characters not English shows as '?'
    I found a few discussions with the same problem (especially this one)

    http://supportforums.BlackBerry.com/T5/Java-development/how-to-show-other-languages-in-BrowserField/...

    and this one

    http://supportforums.BlackBerry.com/T5/Java-development/BrowserField-can-not-display-UTF-8-character...

    but I don't understand, how and where do I I implemented HttpConnection in my code.
    Please, give me advice or tell, how I change my code to solve this problem?

  • Browserfield invalid XMLHttpRequest

    I am launching a javascript inside a BrowserField ajax request.

    Here is a demo application, it's just an html element that is trying to perform an ajax request when the click on.

    public MyScreen() {
            // Set the displayed title of the screen
            setTitle("MyTitle");
    
            BrowserFieldConfig _myBrowserFieldConfig = new BrowserFieldConfig();
    
            _myBrowserFieldConfig.setProperty(
                    BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
            _myBrowserFieldConfig.setProperty(BrowserFieldConfig.ALLOW_CS_XHR,
                    Boolean.TRUE);
            BrowserField browser = new BrowserField(_myBrowserFieldConfig);
            browser.displayContent(
                    ""
                            + ""
                            + "

    AJAX

    Request data
    ", "http://www.w3schools.com"); add(browser); }

    The problem is that even the first alert does not, so there should be a javascript syntax error, but well, everything looks good to me. I tried this code in Firefox on my computer, and alerts are displayed (I know cross-domain is not always possible). So, what is the error in my script?

    I tested on the Simulator with BB 5.0.0 and 7.0.0.

    I find the solution.

    What is the problem, is to use an absolute url to open the XMLHttpRequest. Use a url relativie (demo_get.asp) and the browserfield must have correctly set baseurl (http://www.w3schools.com/ajax/).

    It's very embarrassing.

  • Browserfield problem

    Hello

    I'm developing an application (for version 5.0) for a page Web in a browserfield I self-paced successfully but it takes the Web page fit to the screen it seems as compressed. I need to view this Web page with the actual width and height of the webpage... Currently I am add browserfield vertical Manager and give vertical scrolling for the Manager... Now, I want to display the web page as its width and its original height...

    You get my point? If not please free to ask...

    Can someone explain to me how to display the webpage in real width and height in the browerfield

    The following code snippet shows how to set the width of the window you want and the value of the initial scale...

    config = new BrowserFieldConfig();
    config.setProperty (BrowserFieldConfig.VIEWPORT_WIDTH, whole (new)
    (Display.getWidth ()));
    config.setProperty (BrowserFieldConfig.INITIAL_SCALE, new Float (1.0));

    config.setProperty (BrowserFieldConfig.USER_SCALABLE, Boolean.FALSE);

    browserField = new BrowserField (config);

    The USER_SCALABLE prevents the user to change the zoom.  You can or don't want according to your code.

    VIEWPORT_WIDTH sets the width you want to see.  In our application, limit us the width of the screen and do not allow for scaling.

  • BrowserField - open links in the current browser?

    Hey guys, wondering if one can help me out or give a little guidance on this issue.

    I have a local html string that I displays on a screen inside a BrowserField object, and I want to do is have any link in the field you click to open the link inside a real browsing session. I looked through the API for a method to substitute that manages links, but saw no one, even if I just missed it. Any suggestions?

    Thank you

    Kyle

    Hey guys,.

    I know this thread has been inactive for a while, but I found the solution so I thought id post her if someone else hasn't the same question.

    BrowserFieldConfig bfc = new BrowserFieldConfig();
    bfc.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_CARET);
    bfc.setProperty(BrowserFieldConfig.CONTROLLER, new BrowserFieldController(){
    
                public InputConnection handleResourceRequest(BrowserFieldRequest request)
                        throws Exception {
    
                    return (InputConnection)Connector.open(request.getURL());
                }
    
                public void handleNavigationRequest(BrowserFieldRequest request)
                        throws Exception {
                    BrowserSession b = Browser.getDefaultSession();
                    b.displayPage(request.getURL());
                }
            });
            bf = new BrowserField(bfc);
    

Maybe you are looking for

  • Pavillion dv6: Admin password or power on password problems

    (1) HP Pavilion(2) Windows 7(3) enter the password Admin or power on passwordDisable the system 85098761

  • Can't get rid of "ghost bar" in my page of score

    Hello. I'm working on the X logic with 10.9.5 mac and find in some of my files of music (but not all) that my scores are full of bars (grey) Ghost that I can't remove, even if these measures are not in the page organize. This makes problems with part

  • Windows XP CD rom will not play my game.

    Whenever I put my Cd in my Cd rom Sims pets turns and the small icon flashes on the mouse as if its going to play.  However an error message saying Windows player is not ready, then it has the little message: exception processing message c00000a3 par

  • Installation software for webcam internal 6730 b

    I can't activate my webcam.  I see that the driver is the Manager of devices installed and work properly in.  When I look in the computer - not found.  I recently had my hard drive replaced and the computer technology made me a "favor" to move me fro

  • How to make a dvd using windows movie maker

    How to create a dvd with movie maker. film downloaded from camara tried to create a dvd, but it won't let me it will only do CD that I can't read on my computer or dvd player