| Author |
Trouble adding unique elements
|
Dan Grindstaff
Ranch Hand
Joined: Sep 24, 2006
Posts: 135
|
|
Hello, I am trying to add a group of elements that must be individually named. I have written the code below:
What I get for xml results is the exact number of fields I need but they are all named "ManufacturerPartNumber". Any help greatly appreciated. Thanks!
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
You have a Field object. (A GoDataFeed.Fields.Field object to be specific.) You repeatedly call its setName() method. So presuming that setName does something like setting the value of a private "name" variable inside that object, at the end of all your posted code that "name" variable is going to have the value it was last given.
So my guess is that you should create a new Field object for each field, rather than trying to reuse a single Field object.
|
 |
Dan Grindstaff
Ranch Hand
Joined: Sep 24, 2006
Posts: 135
|
|
|
Thank you very much! Problem resolved.
|
 |
 |
|
|
subject: Trouble adding unique elements
|
|
|