BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 10-13-2008, 04:54 AM   #1
Mikaël Donini
Knows Where the Search Button Is
 
Join Date: Sep 2008
Model: 7100T
PIN: N/A
Carrier: none
Posts: 32
Default run method - ApplicationMenuItem class - current screen values

Please Login to Remove!

In JAVA, I have implemented a new menu item to the "New Appointment" window (of the calendar view).

In the run() method of my ApplicationMenuItem class, I need to retrieve the data that have been written by the user in the summary field.

The problem is the following. Let's suppose the following scenario:

1- The blackberry user enters a value in the summary field of the new appointment.

2- Then he clicks on my new menu item --> now run() method of my ApplicationMenuItem class is executed. At the beginning of the run() method, I need to know the value enters by the user in the summary field.
But as the user has not saved his appointment before invoking my command, I can't access the value of the summary field. I have tested to execute the following code, but it does not work:

Code:
public Object run(Object context) 
	{
		try {
			UiApplication.getUiApplication().getActiveScreen().save();
		} catch (IOException e2) {
			// TODO Auto-generated catch block
			e2.printStackTrace();
		}
		// Here, I would like to retrieve the value of the summary field, but don't know how
		BlackBerryEvent e = (BlackBerryEvent) context;
                String sum = e.getString(Event.SUMMARY, 0); // it is empty; why??
Then, I have tried the following code, but it does not work.
Code:
	public Object run(Object context) 
	{
		BlackBerryEvent e = (BlackBerryEvent) context;
		try {
			e.commit();
		} catch (PIMException e2) {
			// TODO Auto-generated catch block
			e2.printStackTrace();
		}
                String sum = e.getString(Event.SUMMARY, 0); // it is empty, why ????
Do you have any idea?

Thanks in advance,

Mikaël Donini.

Last edited by Mikaël Donini; 10-14-2008 at 02:28 AM..
Offline  
Old 10-13-2008, 08:07 AM   #2
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

The user has to save the change before invoking your menu object.
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Allen-Bradley 1747-M12/A SLC 500 Flash Memory Module New picture

Allen-Bradley 1747-M12/A SLC 500 Flash Memory Module New

$265.00



 Allen Bradley SLC500 Memory Module 1747-M11 Series B picture

Allen Bradley SLC500 Memory Module 1747-M11 Series B

$35.00



Memory Stick RAM Shipping Box - 5 Trays fits 250 DDR5 DDR4 DDR3 DIMM Modules New picture

Memory Stick RAM Shipping Box - 5 Trays fits 250 DDR5 DDR4 DDR3 DIMM Modules New

$41.50



Memory Blister Pack Box for DDR DIMM Module Anti Static - Lot of 6 18 35 100 200 picture

Memory Blister Pack Box for DDR DIMM Module Anti Static - Lot of 6 18 35 100 200

$17.95



2711-NM11 AB PCMCIA Linear Flash Memory Card 256KB Fast Shipping 2711NM11 GQ US picture

2711-NM11 AB PCMCIA Linear Flash Memory Card 256KB Fast Shipping 2711NM11 GQ US

$353.74



NEW Original Allen Bradley 2080-MEMBAK-RTC Memory Module With RTC Plug-In picture

NEW Original Allen Bradley 2080-MEMBAK-RTC Memory Module With RTC Plug-In

$287.09







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