View comments | RSS feed

RecordSet.addItem

Availability

Usage

RecordSet.addItem(record)

Parameters

Parameter
Description
record
The record to add.

Return value

Nothing.

Description

Method. Inserts a record into the RecordSet object. When you use the addItem method, avoid the following conditions:

Error handling

Error condition
What happens
Error message
The record parameter is not an object.
The record is added to the RecordSet object.


The record parameter has unknown or missing fields.
The record is added to the RecordSet object.


The RecordSet object is server-associated but not fully populated.
No record is added to the RecordSet, and an error message is reported to the Flash MX output window and Debug Console.
Operation not allowed on partial RecordSet objects.

Example

The following example demonstrates the addItem method:

#include "NetServices.as"
var productList = new RecordSet(["ProductName", "Price", "Color"]);
var itemToAdd = {ProductName: "magicbubbles"; Price: 1, Color: 0x987654);
productList.addItem(itemToAdd);

See also

Constructor for RecordSet, RecordSet.addItemAt

Comments


bloomk said on Sep 27, 2003 at 5:11 PM :
There seems to be an error in your example code.

var itemToAdd = {ProductName: "magicbubbles"; Price: 1, Color: 0x987654);
this causes syntax errors.
jrunrandy said on Sep 29, 2003 at 7:44 AM :
There are two problems with:

var itemToAdd = {ProductName: "magicbubbles"; Price: 1, Color: 0x987654);

First, the line should end with a curly brace, not a parenthesis, and magicbubbles shouldn't have a semicolon after it, but a comma:

var itemToAdd = {ProductName: "magicbubbles", Price: 1, Color: 0x987654};

 

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/asDict27.htm