Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 45
Registered: ‎08-29-2013
My Device: Blackberry curve-9360 and Blackberry bold-9860
My Carrier: Company

BrowserField displayContent show Blank Screen



I have used BrowserField to load URL. The URL first show form, When i enter text and submit it, it switches to thanks page.

The browser field always load form page but when i submit the text it sometimes show me white page. I have also try in device browser and it always load url properly.


Here is my code :


BrowserField browserField = new BrowserField();

add( browserField );

browserField.requestContent( "myURL;interface=wifi" );


I also tried with browsetfieldlistener


       StreamConnection c = null;
        InputStream s = null;
        byte[] response = null;
        try {
            c = (StreamConnection)Connector.open("myURL;interface=wifi");
            s = c.openInputStream();

            response = IOUtilities.streamToBytes(s);
        } catch (Exception e) {
        } finally {
            if (s != null)
                try {
                } catch (IOException e) {
            if (c != null )
                try {
                } catch (IOException e) {
        String html = new String(response);
        System.out.println("----html content---"+html);        
         BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();
         myBrowserFieldConfig.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
         BrowserField browserField = new BrowserField(myBrowserFieldConfig);
         BrowserFieldListener bfl = new BrowserFieldListener() {
                public void documentLoaded(BrowserField browserField,
                    Document document) throws Exception {

                        super.documentLoaded(browserField, document);
                        // Performing some operation

         browserField.displayContent(html, "myURL;interface=wifi");


Please suggest me whats the problem


Thanks in advance