View comments | RSS feed

RecordSet.replaceItemAt

Availability

Usage

RecordSet.replaceItemAt(index, record)

Parameters

Parameter
Description
index
The index number of the record.
record
The record to add.

Return value

Nothing.

Description

Method. Replaces a record in the RecordSet object at the specified index. The specified index must identify an existing record. The record's contents are replaced with the contents of the record parameter. The record's ID does not change. When you use the replaceItemAt method, avoid the following conditions:

Error handling

Error condition
What happens
Error message
The RecordSet object is server-associated but not fully populated.
No change is made to the RecordSet object, and an error message is reported to the Flash MX output window and Debug Console.
Operation not allowed on partial RecordSet objects.
Index out of range
The RecordSet object is not changed.


Unknown field name
The RecordSet object is not changed.


Example

The following example demonstrates the replaceItemAt method:

#include "NetServices.as"
var productList =new RecordSet(["ProductName","Price","Color"]);
var itemToAdd = {ProductName:"magicbubbles",Price:1,Color:"0xb00fed"};
productList.addItem(itemToAdd);
myListBox.setDataProvider(productList);
var replacementItem ={ProductName:"kiddyShampoo", Price:2, Color:"0xd00d1e"};
productList.replaceItemAt(0,replacementItem);

See also

Constructor for RecordSet, RecordSet.addItem, RecordSet.addItemAt

Comments


No screen name said on Aug 7, 2004 at 8:22 PM :
Cool

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flashremoting/mx/Using_Flash_Remoting_MX/asDict40.htm