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


GE Voltage Stabilizer 10 KVA Transformer Pri 175-235/190-260/380-520 Sec 120/240 picture

GE Voltage Stabilizer 10 KVA Transformer Pri 175-235/190-260/380-520 Sec 120/240

$648.00



PHENIX TECHNOLOGIES HIGH VOLTAGE DIVIDER PHE001SC3 FOR Kilovoltmeters picture

PHENIX TECHNOLOGIES HIGH VOLTAGE DIVIDER PHE001SC3 FOR Kilovoltmeters

$2507.99



Phoenix Contact Voltage Distribution Block Part No. 2315269 picture

Phoenix Contact Voltage Distribution Block Part No. 2315269

$30.00



Low Voltage Protector Disconnect Switch Digital Over-Discharge Protection Module picture

Low Voltage Protector Disconnect Switch Digital Over-Discharge Protection Module

$14.35



Renogy 500A Battery Monitor High and Low Voltage Programmable Alarm 500A Shunt picture

Renogy 500A Battery Monitor High and Low Voltage Programmable Alarm 500A Shunt

$70.99



USB Type C Voltmeter Current Meter Multimeter Voltage Digital Tester Detector  picture

USB Type C Voltmeter Current Meter Multimeter Voltage Digital Tester Detector

$105.43







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