02-21-2011 12:30 AM - edited 02-21-2011 12:32 AM
Hi,
Please help me quickly with my below requirement of managing context menu -
Context Menu:
1/ I require the context or shortcut menu (the menu that you get by clicking the blackberry menu item).
2/ Require to add and remove menu items at runtime based on some events.
3/ Menu items should be different in each page being navigated through.
4/ Also let me know how to know which context menu has been clicked and how can i pass the value to a next page.
Please note that I am using Visual Studio with BlackBerry web plugin vers 2.5 and Javascript.
I found examples on java but not through javascript in Visual studio environment.
Regards,
Giridhar
02-28-2011 02:11 AM
Have done the following steps:
1) wrote the below script in <html> - <head> tags
<
script type="text/javascript">
var item = blackberry.ui.menu.addMenuItem(item);
item = new blackberry.ui.menu.MenuItem(false, 1, "Hello World", clickMe);
function clickMe() {
alert("user just clicked me");
}
</
script>
2) Getting the below error :
Running at line 1: var item=new blackberry.ui.menu.MenuItem(false,1,"Hello World",clickMe);.
: TypeError: Cannot convert 'undefined' to an object.
Can anyone let me know why am i getting this error. My config.xml has access and feature as -
<access uri="http://www.blackberry.com" subdomains="true">
<feature id="blackberry.ui.menu" required="true" version="1.0.0.0" />
</access>
Regards,
Giridhar
02-28-2011 07:49 AM
This issue is likely that you have the <feature> nested under the <access> element for www.blackberry.com.
When you put the <feature> element at the root of the document it will allow the functionality for any local pages you have packaged in your application.
02-28-2011 08:06 AM
Done as suggested... yet getting the same error. How did anybody implemented this context menu handling from a vs.net environment.
03-01-2011 01:05 AM
My Config.xml reads as below -
<?xml version="1.0" encoding="utf-8"?>
<widget xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0" rim:header="RIM-Widget:rim/widget" xmlns="http://www.w3.org/ns/widgets">
<name>FlightEventsManager</name>
<description />
<author href="" rim:copyright="" email="">Giridhar</author>
<content src="LoginPage.html" />
<feature id="blackberry.ui.menu" required="true" version="1.0.0.0" />
<feature id="blackberry.ui.dialog" required="true" version="1.0.0.0" />
<access uri="http://www.blackberry.com" subdomains="true"></access>
<license href="" />
<rim:cache disableAllCache="false" aggressiveCacheAge="2592000" maxCacheSizeTotal="1024" maxCacheSizeItem="128" />
</widget>
03-01-2011 07:51 AM - edited 03-01-2011 07:52 AM
Ahh.... It looks like you've run into the infamous "can't use dialog and menu in the same app" bug. This is something that will be fixed and released in a couple of weeks from now
More details here:
If you remove <feature id="blackberry.ui.dialog"/> from your config.xml element then the menu's will work. It is a really odd issue around mixing built in APIs on the device and ones built into the webworks application.
03-31-2011 12:57 PM
Any idea when the release is coming?
TIA
03-31-2011 12:59 PM
We're trying to line this release up with the RTM version of the PlayBook WebWorks SDK... Which should be in and around the PlayBook launch in mid April.