Welcome!

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

Reply
Developer
packiaraj
Posts: 231
Registered: ‎07-09-2009
Accepted Solution

Browserfield problem

Hi,

      I'm developing an application(for 5.0 version) to display a webpage in a browserfield i have successfully display it but it takes the webpage fit to the screen so it seems like compressed. I need to display the webpage with actual width and height of the webpage....Currently i'm adding browserfield to the vertical manager and give vertical scroll for that manager.. Now i want to display the web page as its original width and height...

 

Got my point? if no please free to ask..

 

Can any one explain me how to display the webpage in actual width and height in the browerfield

Please use plain text.
Developer
ronrad
Posts: 22
Registered: ‎07-22-2009

Re: Browserfield problem

The following code snippet shows how to set the width of the viewport you would like, and the initial scale value ...

 

    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);

        browserField = new BrowserField(config);

 

The USER_SCALABLE prevents the user from changing the zoom.  You may or may not want that depending on your code.

 

VIEWPORT_WIDTH sets the width that you wish to view it at.  In our applciation, we limit the width to the screen and don't allow scaling.

Please use plain text.
Developer
ronrad
Posts: 22
Registered: ‎07-22-2009

Re: Browserfield problem

In your case, I think you would want to just set the initial scale to 1.0 and your managers should give you the scrolling to original size.

Please use plain text.
Developer
packiaraj
Posts: 231
Registered: ‎07-09-2009

Re: Browserfield problem

Thanks for your quick reply ronrad now its work and one more question how to show progress or loading in browserfield...

 

Thanks once again.. i will make this thread as solved once you reply this thread...

Please use plain text.
Developer
ronrad
Posts: 22
Registered: ‎07-22-2009

Re: Browserfield problem

Hi,

 

For progress, please look through the following:

 

 

http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/browser/field2/BrowserFieldLis...

 

Create a class that implements BrowserFieldListener, and then do a BrowserField.addListener(newClass);

 

You will receive progress callbacks on the listener class.

 

Please use plain text.
New Contributor
farahhanif
Posts: 7
Registered: ‎01-07-2011

Re: Browserfield problem

From the different methods in BrowserFieldListener class, ONLY documentLoaded gets invoked. NO other method is invoked. Is there are solution to this?

Please use plain text.
New Contributor
mshaz
Posts: 7
Registered: ‎10-29-2010

Re: Browserfield problem

[ Edited ]

farahhanif, what device(s) are you seeing this problem with BrowserFieldListener? 

 

On the Torch 9800, the documentUnloading() method in BrowserFieldListener is never called. Works fine on 5.0 devices so it looks like something was broken. I have opened a defect for this using the RIM Bug Tracker back in October but have not seen any movement on it.

Please use plain text.
New Contributor
farahhanif
Posts: 7
Registered: ‎01-07-2011

Re: Browserfield problem

On the 9700 with OS 5.0, none of these listener methods get invoked:

1. downloadProgress,

2. documentError,

3. downloadAborted, and probably more.

 

Farah.

Please use plain text.
Developer
Astarot82
Posts: 53
Registered: ‎10-29-2010

Re: Browserfield problem

The link to the defect from mshaz is broken... what was the last status of that bug?

Please use plain text.
New Contributor
mshaz
Posts: 7
Registered: ‎10-29-2010

Re: Browserfield problem

 

It's probably a permissions issue as I can view the bug report fine. I've posted a PDF of the report at http://bit.ly/dKUeXi 
The bug is currently in the Triage status and has not yet received any comments from development. This was a huge problem for us that we had to work around on the Torch.
Mike

 

Please use plain text.