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 Contributor
Posts: 9
Registered: ‎03-02-2011
My Device: Torch 9800
Accepted Solution

How to display "Add contact" dialog with non-empty fields?

On BlackBerry I want to display an "Add contact" dialog with some fields populated.

I supposed the following code would work:

 

BlackBerryContact contact = (BlackBerryContact) mContactList.createContact();

populateSomeFields (contact);

AddressBookArguments args = new AddressBookArguments( AddressBookArguments.ARG_NEW, contact);

Invoke.invokeApplication(Invoke.APP_TYPE_ADDRESSBOOK, args);

 

but no way. If I Invoke with ARG_NEW a completely EMPTY fields are displayed.

 

If I Invoke with ARG_COMPOSE an IllegalArgumentException is thrown. Is there any way I can display "Add contact" with some fields filled in?

Highlighted
Super Contributor
Posts: 278
Registered: ‎11-04-2010
My Device: 4.5 and above
My Carrier: none

Re: How to display "Add contact" dialog with non-empty fields?

Hi randesco,

  For this use listField and customise it based on your requirement.

 

BlackBerryContactList contacts = (BlackBerryContactList)BlackBerryPIM.getInstance().openPIMList(BlackBerryPIM.CONTACT_LIST, BlackBerryPIM.READ_WRITE);
            Object contact_selected = contacts.choose();

 

Thanks & Regards

         pp

Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to display "Add contact" dialog with non-empty fields?

just as an idea: maybe you have to commit the contact prior to opening the compose view?
otherwise it may not be possible, you'd have to write your own GUI to edit the contacts fields.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Contributor
Posts: 9
Registered: ‎03-02-2011
My Device: Torch 9800

Re: How to display "Add contact" dialog with non-empty fields?


simon_hain wrote:
just as an idea: maybe you have to commit the contact prior to opening the compose view?
otherwise it may not be possible, you'd have to write your own GUI to edit the contacts fields.
If I fill some fields in "Add contact" then user can press "cancel" and the contact will not appear in contact list.

In your approach it would be added. It is the big difference.
New Contributor
Posts: 9
Registered: ‎03-02-2011
My Device: Torch 9800

Re: How to display "Add contact" dialog with non-empty fields?

It seems to me commiting contact prior to calling ARG_VIEW with it - is the only reasonable solution. Thank you all.