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
New Contributor
ykuznetsov
Posts: 9
Registered: ‎09-21-2010
My Device: 9700
Accepted Solution

app crashing using javascript in browserfield2 sdk 6.0

Hi all!

I have my app crashed allmost all time I invoke javascript in browserfield to scroll text in it. Sometimes it works only when javascript is invoked first time.

sdk 6.0

device also has 6.0 sdk

 

 

class MyBrowserFieldView extends MainScreen implements RenderingApplication {

 

    RenderingSession renderingSession;

    BrowserField browserField;

    VerticalFieldManager verticalFieldManager;

 

    public MyBrowserFieldView(){          

        addMenuItem(new MenuItem("Scroll to", 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!

 

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

Re: app crashing using javascript in browserfield2 sdk 6.0

Is it possibly this?

Please use plain text.
New Contributor
ykuznetsov
Posts: 9
Registered: ‎09-21-2010
My Device: 9700

Re: app crashing using javascript in browserfield2 sdk 6.0

Thanks, I hope this is it, I'll check it.

Please use plain text.
New Contributor
ykuznetsov
Posts: 9
Registered: ‎09-21-2010
My Device: 9700

Re: app crashing using javascript in browserfield2 sdk 6.0

Yes, using another thread has helped. Thanks again!!!

Please use plain text.