Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-4921

ContactField Full Example only returns 1 contact

    XMLWordPrintableJSON

Details

    Description

      There is something unusual about the documented Full Example for ContactField [1]

      The code example saves a bunch of phone number contacts and then does a contacts.find presumably to demonstrate that the phone numbers just saved can be retrieved OK.

      The problem with the example is that the options does not specify multiple=true and since the default is options.multiple=false [2] there will never be multiple contacts returned. So the example won't display all what just got saved, and it is also contrary to the way the onSuccess method is expecting to iterate over multiple contacts.

      I think the code should say

      options.multiple=true;

      [1] http://cordova.apache.org/docs/en/3.0.0/cordova_contacts_contacts.md.html#ContactField
      [2] http://cordova.apache.org/docs/en/3.0.0/cordova_contacts_contacts.md.html#contactFindOptions

      Attachments

        Activity

          People

            vladimir.kotikov Vladimir Kotikov
            dinglemouse Peter
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: