• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

can you add an item to a value object??? Error: 1069

New Here ,
May 07, 2010 May 07, 2010

Copy link to clipboard

Copied

hey guys... so i have a webservice which returns me ome datatypes called tagInfo, i was wondering if there is a way i can create a new property to a value object??

ive tried something like

        var obj:Object = new Object();
        obj.approved = false;
        tagArr.addItem(obj);
        displayTagArr.addItem(tagArr);

and it gives me an error on the line "tagArr.addItem(obj);"

the error states

Error #1069: Property addItem not found on valueObjects.TagInfo and there is no default value.

thanks

Views

234

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 30, 2010 May 30, 2010

Copy link to clipboard

Copied

LATEST

Hi,

I presume you would like to add your own property to the object. In DCD, if you look at the generated valueobjects under the package named valueObjects, you will see for each entity, a set of three classes

for your example it will be

1 . _tagInfo_typeEntityMetadata

2 . _Super_tagInfo_type

3.  tagInfo_type

1 & 2 are regenerated from time to time. So hence do not make any changes to it. By default you cannot dynamically add properties to any class(except of type Object). The way to achieve this functionality is by adding the dynamic keyword like this

public dynamic class tagInfo_type extends _Super_tagInfo_type

Now, For how to add the property, all you need to do is this,

tagInfo_type.approved = false;

The addItem function is used to add a value to a collection. It cannot be used to add properties.

Hope this helps.

Nishad

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines