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
scottolle
Posts: 17
Registered: ‎02-24-2010
My Device: 9700
Accepted Solution

Navigating back from a remote resource in the Visual Studio Plug-in

Environment:  32-bit Windows 7, most recent Java development environment from Sun, Visual Studio 8 most recent BlackBerry Beta Plug-in, 9700 Simulator working fine, whitelisted remote .NET/ASP/SQL Server 2008 to use as remote formatted page server, XMLHTTP requests,  and possibly direct .asp service calls.

 

I have built a skeleton Plug-in widget.  It has 7 menu options that call a message box to confirm that the menu item has fired.  The menus are loaded from JavaScript on the onload of the the index.htm.  I can navigate to a remote resource using the blackberry.ui.menu function which sets the location.href.  The remote site has been been whitelisted so it comes up, poorly formatted, but that is another issue. 

 

After navigating to this remote web page using location.href... the blackberry.ui.menu items still show, but they are dead, likely out of context.  They don't fire the confirmation message boxes as they do from the start up index.htm page, and there is no way to navigate back from the remote page back to the local index.htm.page.  At least not from the menu items. 

 

I have tried adding permissions in the config.xml to the resource for blackberry.ui.menu and a bunch of other items and nothing seems to help.  I have tried in the menu adding a htpp:///index.htm 3 slashes to get back to the local resource as I have seen in other posts, but since the menu, I believe, is out of context it ignores it or simply can't find the function.

 

Any suggestions? 

Do I need to change the remote web site and handle the menu events? 

Is there some way to make the menu items available to the application globally so it doesn't matter where I go the menus still are available?

 

I have no idea what to try next.

 

Regards,

Scott

Retired
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Navigating back from a remote resource in the Visual Studio Plug-in

If you wish to have menu items that are used globally for both local and remote content, you will have to link in a JavaScript file in each of those occasions and register your menu items.

 

The fact that the menu items are lingering after you browse to another page is a bug. You can get around this by either:

1) Clear the menu items before moving to the next page

2) On the load of the next page clearing the menu items.

 

If you change the location.href and then use the back button on the device, it should move back to the previous page in the history.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter