Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 20
Registered: ‎10-20-2008
My Device: Not Specified

how to create a duplicate of the BB calendar

[ Edited ]

hi all ,

i read through the blackberry development guide "Using PIM applications" -"Using the calendar"

and ran through the samples ,

when i create an appointment and save it , it got reflected in my BB calendar , but here i want to have another copy of calendar named "Abc Calendar" when i save it , it shld get reflected there where i should not disturb the original calendar

 

any ideas , any helps would be greatly appreciated

 

thanks

 

Message Edited by mobileberrit007 on 12-02-2008 12:11 PM
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: how to create a duplicate of the BB calendar

From the device context there is only one calendar instance.

 

If you wish to create an additional calendar - implement the calendar functionality in your application and link your application (when necessary) to the device calendar.

New Developer
Posts: 20
Registered: ‎10-20-2008
My Device: Not Specified

Re: how to create a duplicate of the BB calendar

thanks for your reply ,

so you mean from the device perspective there is no use even if i create an instance

for the calendar ?

can you plz explain me ?

 

 

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: how to create a duplicate of the BB calendar

[ Edited ]

If you check javadoc for javax.microedition.pim.PIM class that is factory for calendar instance you can see that there is one way to get calendar via PIM.getInstance().openPIMList(type, mode)

 

There is only one suitable type: PIM.EVENT_LIST

 

and it refers to the device calendar

 

there is no way to specify another calendar instance into this method.

Message Edited by tbilisoft on 12-02-2008 06:01 PM
New Developer
Posts: 20
Registered: ‎10-20-2008
My Device: Not Specified

Re: how to create a duplicate of the BB calendar

thanks , can you tell where i can see the BB's calendar functionality code

 

Developer
Posts: 16
Registered: ‎10-27-2008
My Device: Bold

Re: how to create a duplicate of the BB calendar

It is possible to have multiple calendars on the device (BIS calendar for example).

 

In PIM there is this method openPIMList(int pimListType, int mode, String name) which the doc says "Opens the specified PIM list"

 

If you knew the name of the calendar you wanted to get, it does look possible to add events to it. 

 

You can use String[] listPIMLists(int pimListType) in PIM to get the names of the PIM lists of type  EVENT_LIST and see what is available.

 

 

 

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: how to create a duplicate of the BB calendar

[ Edited ]

What version of JDE are you using ?

 

My answer was about JDE 4.0.2

 

Just checked on JDE 4.2.1 there is method to work with multiple PIMLists

 

But I've no experience with that.

Message Edited by tbilisoft on 12-02-2008 06:27 PM
Developer
Posts: 16
Registered: ‎10-27-2008
My Device: Bold

Re: how to create a duplicate of the BB calendar

openPIMList with the name parameter is documented as of 4.0.0
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: how to create a duplicate of the BB calendar

Yes, you're absolutely correct and I was wrong in my suggestion.

 

Could you please explain - how a user will open the second calendar via user interface ?

Developer
Posts: 16
Registered: ‎10-27-2008
My Device: Bold

Re: how to create a duplicate of the BB calendar

On my device, if you go to the calendar you get a "Select Calendar..." menu item. It is possible it would not show up unless you have a second calendar (for a BIS account or from some other method).