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

Web and WebWorks Development

Reply
Contributor
Posts: 12
Registered: ‎02-29-2012
My Device: non yet
My Carrier: O2 Germany

Accessing Contacts in a webworks app (Enyo port from webOS)

Hi,

 

I am porting an app that uses the enyojs.com framework from webOS. It will use a cheap online service to send sms messages. Therefore I want the user to be able to select a contact from the playbooks contacts. In webOS I use the enyo PeoplePicker.

 

Is there a way to search the contacts on the playbook? 

 

Thanks LinuxQ

Developer
Posts: 214
Registered: ‎01-07-2011
My Device: Bold 9900
My Carrier: Rogers

Re: Accessing Contacts in a webworks app (Enyo port from webOS)

This API hasn't been exposed yet on the playbook.
--
Rory (@roryboy)
Click "Accept as Solution" if post solved your original issue. Give like/thumbs up if you feel post is helpful
Contributor
Posts: 12
Registered: ‎02-29-2012
My Device: non yet
My Carrier: O2 Germany

Re: Accessing Contacts in a webworks app (Enyo port from webOS)

[ Edited ]

On Twitter @blackberrydev told me I could use "Blackberry.pim.contact.find". Thus I tried the following code to test if it works at all. Since It won't work on the simulator, I found someone on twitter who was so kind to try it on a playbook for me! 

 

BTW: I use webOS's Enyo-Framework (www.enyojs.com) This is my test code 

 

filter = this.$.SearchFor.getValue();
this.$.txtStatus.setContent("Searching for fist name: " + filter);
helptext = "";

// Create a FilterExpression with "firstName" equals to filter 
var feFirst = new blackberry.find.FilterExpression("firstName", "==", filter);

var result2 = blackberry.pim.Contact.find(feFirst);
for (i = 0; i < result2.length; i++) {
helptext = helptext + "," + result2[i].firstName;
//alert(result2[i].firstName);

}
this.$.txtStatus.setContent("Found " + result2.length + ": " + helptext);

 

IMO the result should print the number of contacts found with that first name and list them (of course they are all the same). BUT the playbook only sets the Status message to ""Searching for".

 

Is my code wrong? Is there a way that I can test that on the simulator or can the one who tests it on a device, access some logs?

 

I did submit my app without contact search but an update with it would make it MUCH more usable!

 

Thanks

 

LinuxQ