Open GoogleCodeExporter opened 9 years ago
Looks like this has something to do with the change introduced in version 3.0
of GData Contacts API:
http://code.google.com/apis/contacts/docs/3.0/migration_guide.html#Java
***
Replace the uses of ContactEntry.setTitle (and getTitle) with appropriate uses
of ContactEntry.setName(Name
name). Note that the Name is not a simple string, but a whole structure
consisting of several name components,
so in reality the necessary adaptations will be more complex.
Original comment by peter.on...@gmail.com
on 5 Apr 2010 at 9:59
The getName/setName methods are missing from the PersonEntry class, which
ContactEntry inherits from. The gwt-gdata is auto-generated from the JS docs
(http://code.google.com/apis/gdata/jsdoc/2.2/index.html). Since the PersonEntry
class
is missing from the JS docs in 2.2, gwt-gdata 2.2.1 is missing some methods for
PersonEntry.
You can easily add the missing getName/setName methods using JSNI:
private native void setName(ContactEntry entry, com.google.gwt.gdata.client.Name
name) /*-{
entry.setName(name);
}-*/;
private native com.google.gwt.gdata.client.Name getName(ContactEntry entry) /*-{
return entry.getName();
}-*/;
You can the set the entry's name using the following:
ContactEntry entry = ContactEntry.newInstance();
GivenName john = GivenName.newInstance();
john.setValue("John");
FamilyName smith = FamilyName.newInstance();
smith.setValue("Smith");
Name name = Name.newInstance();
name.setGivenName(john);
name.setFamilyName(smith);
setName(entry, name);
The next version of gwt-gdata will correct this issue. Thanks for reporting it.
Original comment by non.gwt....@gmail.com
on 29 Apr 2010 at 5:22
Original comment by bobbysoa...@gmail.com
on 29 Apr 2010 at 5:23
doing the workaround you suggest results in the following error
An error occurred while creating a contact: [Line 1, Column 887, element
gd:familyName] Unknown attribute: '__gwt_ObjectId'
Original comment by u...@worldticket.net
on 27 Dec 2011 at 12:07
Original issue reported on code.google.com by
peter.on...@gmail.com
on 20 Mar 2010 at 10:15