Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting Items into Icolls

Status
Not open for further replies.

FearsomeFastFemale

Programmer
Nov 19, 2002
23
GB
Hi,

I am trying to insert and Item into an IndexedCollection. I can use addElement(obj) to add to the end of the Icoll but can get insertElement or addElement(obj,int) to work (fails syntax check in java)

Any help would be appricated

example add code that adds at the end I want to insert/add at the start.

IndexedCollection selectedIColl = null;
Context mycontext = getContext();
selectedIColl = (IndexedCollection) mycontext.getElementAt ("fredlist.list");

DataElement blankEntry = (DataElement)com.ibm.dse.base.types.DSEType.getExternalizer().readObject("fred");
blankEntry.setName("fredentry");
selectedIColl.addElement(blankEntry);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top