BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 02-15-2007, 12:48 PM   #1 (permalink)
New Member
 
Join Date: Feb 2007
Model: 7100T
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Add a MenuItem to MENUITEM_ADDRESSCARD_VIEW

Please Login to Remove!

Hi,

I'm trying to add a menuItem to the contact's contextMenu for every contact with email address, and for those who does not have an email address i want to grey the menu or remove it.

all i managed to do is add a menuItem to all contacts.
I tried to add an ApplicationMenuItem with specific Contact context from the PIM:

Code:
Contact c = (Contact)contacts.elementAt(i);
amir.addMenuItem(ApplicationMenuItemRepository.MENUITEM_ADDRESSCARD_VIEW, new SampleMenuItem(c));
contacts is a vector of PIM Contacts
amir is ApplicationMenuItemRepository
SampleMenuItem is a class that extends ApplicationMenuItem

Is this code is right? what am i missing here?

I see no difference between ApplicationMenuItem contructor with Contact context and the constructor without Contact context.

public ApplicationMenuItem(Object context, int order)
public ApplicationMenuItem(int order)

thanks
Eitan.
Offline  
Old 02-18-2007, 01:15 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2006
Model: 8707g
Carrier: Hutch
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Current API's don't allow you to selectively show ApplicationMenuItems depending on conditions. It will always be visible for all types of contacts in your case. However you can try getting the selected contact and change the text of the menu.
The text to be shown in menu can be changed by returning a different value from toString() method.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

HSS 15PCS VALVE SEAT & FACE CUTTER 45DEC 30DEC 20DEC FOR VINTAGE CAR, BIKES,JEEP
$196.99
HSS 15PCS VALVE SEAT & FACE CUTTER 45DEC 30DEC 20DEC FOR VINTAGE CAR, BIKES,JEEP pictureVintage Dodel Dental Elevator Antique Oral Surgery Set Dec 4 1900
$100.0
Vintage Dodel Dental Elevator Antique Oral Surgery Set Dec 4 1900 pictureVintage General Electric Small Motor Pat. Dec 12 1911 Schenectady N.Y. U.S.A.
$49.99
Vintage General Electric Small Motor Pat. Dec 12 1911  Schenectady N.Y. U.S.A.  picturevery rare vintage collectible purple ceramic DEC 304ES GOLD
$18.9
very rare vintage collectible purple ceramic DEC 304ES  GOLD  pictureTruck Blue Book - July 1-Dec 31 1970 Vintage Valuations National Market Reports
$4.99
Truck Blue Book - July 1-Dec 31 1970 Vintage Valuations National Market Reports picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.