BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 10-10-2008, 11:12 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.
Offline  
Old 10-10-2008, 12:21 PM   #2
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

Read the SPI docs for PIMItem. You can retreive the various values from the event using this interface.
Offline  
Closed Thread



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


New Factory Sealed AB 1756-L62 SER B ControlLogix 4MB Memory Controller 1756L62 picture

New Factory Sealed AB 1756-L62 SER B ControlLogix 4MB Memory Controller 1756L62

$505.00



Conexant 3652B-RD02D110 RD02-D110 E93908 Modem and memory card picture

Conexant 3652B-RD02D110 RD02-D110 E93908 Modem and memory card

$6.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



2 - RAM DRAM Tray-Container Box For Server PC Memory DIMM Modules - Fits 100 NEW picture

2 - RAM DRAM Tray-Container Box For Server PC Memory DIMM Modules - Fits 100 NEW

$21.90



1PC NEW Memory card 2711-NM11 2711-NM11 SPOT STOCK picture

1PC NEW Memory card 2711-NM11 2711-NM11 SPOT STOCK

$364.61



Dental Endodontic Endo Memory Engine Rotary Root Canal NiTi File 25mm files 6PCS picture

Dental Endodontic Endo Memory Engine Rotary Root Canal NiTi File 25mm files 6PCS

$349.50







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