If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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

Web and WebWorks Development

Reply
Contributor
binnyb
Posts: 19
Registered: ‎11-02-2010
My Device: Not Specified

menu item click takes 30+ seconds to respond

[ Edited ]

I create a menu item like this:

 

 

function callbackSettings() {
     showPage('settings');
}
function createMenu() {
     var mSettings = new blackberry.ui.menu.MenuItem(false, 1, "Settings", callbackSettings);
     blackberry.ui.menu.addMenuItem(mSettings);
}
when i click on the "Settings" item in the menu, it takes about 30+ seconds to show the settings page.  There is nothing fancy going on in showPage('settings') and other calls to this function are working fine.  
here is the showPage for settings:
 if(_allowNotifications == 1)
 pushStatusDiv.innerHTML = 'some text';
else
 pushStatusDiv.innerHTML = 'text text';
why is it so slow? it seems to lock up the UI and i cannot do anything at all until it finishes

 

 

edit: i notice this is only lagging while on the simulator for bold 9700 and on an actual device curve 9300. on the torch it works fine

Please use plain text.
Administrator
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: menu item click takes 30+ seconds to respond

Hello,

 

What is happening in "showPage('settings');" ?

 

From your description of the user experience, either there is a lot of processing going on that is blocking the event thread, or something is freezing up.  Do you have any calls to a custom JavaScript extensions within showPage()?

 

Cheers,

Adam

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
Contributor
binnyb
Posts: 19
Registered: ‎11-02-2010
My Device: Not Specified

Re: menu item click takes 30+ seconds to respond

[ Edited ]

all i am doing is modifying some div's styles and using innerHTML like i mentioned in my original post.

 

function showPage(page) {

 switch(page) {

 case 'home':

 homeDiv.style.display = 'block';

 ...//more of the same

 break;

 ...//more case statements with similar code

 case 'settings':

 ...//similar div style manipulation

 

 if(_allowNotifications == 1)
pushStatusDiv.innerHTML = pushStatusOnHTML;
else
pushStatusDiv.innerHTML = pushStatusOffHTML;

 

 break;

 }

lastPage = page;

divMain = document.getElementById('divMain');

if(divMain.offsetHeight < screen.height)

 divMain.style.height = screen.height + 'px';

}

 

Edit; I have found that the last few lines of the function showPage(...) is causing the hangup, but i dont know why. any insight?

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: menu item click takes 30+ seconds to respond

Hi binnyb,

 

Which version of the Widget SDK are you using?  There were threading issues with menu items in earlier versions of the SDK that have since been fixed.  I'm wondering if these might be the root of the problem.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Contributor
binnyb
Posts: 19
Registered: ‎11-02-2010
My Device: Not Specified

Re: menu item click takes 30+ seconds to respond

copied from Eclipse Installation Details for Blackberry Widget SDK:

 

    BlackBerry Widget SDK 1.0.0.201003191451-126

    BlackBerry Web Plug-in 2.0.0.201003191451-33

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: menu item click takes 30+ seconds to respond

I would recommend upgrading to the new 2.5 Eclipse plug-in that includes the Widget SDK 1.5 which has the threading fixes.  That might solve your issue

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Contributor
binnyb
Posts: 19
Registered: ‎11-02-2010
My Device: Not Specified

Re: menu item click takes 30+ seconds to respond

[ Edited ]

OK thanks - i am downloading 2.5 right now.  It seems i cannot update my current installation so i am downloading the full eclipse + widget installation file.

 

the error is:

 

 

Cannot complete the install because one or more required items could not be found.
  Software being installed: BlackBerry Web Plug-in 2.5.0.201009142140-15 (net.rim.browser.tools.feature.feature.group 2.5.0.201009142140-15)
  Missing requirement: BlackBerry Widgetconfig Model Plug-in 2.5.0.201009142140-15 (net.rim.browser.tools.widgetconfigmodel 2.5.0.201009142140-15) requires 'bundle org.eclipse.emf.ecore [2.6.0,2.7.0)' but it could not be found
  Cannot satisfy dependency:
    From: BlackBerry Web Plug-in 2.5.0.201009142140-15 (net.rim.browser.tools.feature.feature.group 2.5.0.201009142140-15)
    To: net.rim.browser.tools.widgetconfigmodel [2.5.0.201009142140-15]

 

Cannot complete the install because one or more required items could not be found.  Software being installed: BlackBerry Web Plug-in 2.5.0.201009142140-15 (net.rim.browser.tools.feature.feature.group 2.5.0.201009142140-15)  Missing requirement: BlackBerry Widgetconfig Model Plug-in 2.5.0.201009142140-15 (net.rim.browser.tools.widgetconfigmodel 2.5.0.201009142140-15) requires 'bundle org.eclipse.emf.ecore [2.6.0,2.7.0)' but it could not be found  Cannot satisfy dependency:    From: BlackBerry Web Plug-in 2.5.0.201009142140-15 (net.rim.browser.tools.feature.feature.group 2.5.0.201009142140-15)    To: net.rim.browser.tools.widgetconfigmodel [2.5.0.201009142140-15]

 

how do i fulfill these dependencies? wish i could just install it ugh!

 

will i run into trouble using my current code signing keys if i start using another eclipse installation?

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: menu item click takes 30+ seconds to respond

[ Edited ]

To be perfectly honest.. the darn Eclipse update site mechanism causes me so many headaches :smileysad:  (I just took some Advil)

 

I always recommend everyone to simply download the full installer.  My guess is that it isn't working for you because the new version of the plug-in requires 3.6 and some other dependencies.  These are all included and pre-configured for you in the full installer.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Contributor
mmzepedab
Posts: 22
Registered: ‎09-01-2010
My Device: Blackberry 8900
My Carrier: Tigo Honduras

Re: menu item click takes 30+ seconds to respond

Yes it gives me headaches too, I'm trying to update it right now but it wouldn't let me, what i did was to change this site http://www.blackberry.com/go/eclipseUpdate/3.6/web to this one http://www.blackberry.com/go/eclipseUpdate/3.4/web and it started installing i'll see what happens.

Please use plain text.