cancel
Showing results for 
Search instead for 
Did you mean: 

update multi valued properties

anusk
Champ in-the-making
Champ in-the-making
Hi,

I want to upload a multiple properties via webscript. Itried with

content.properties["myModel:myProperty"]=value;
  but this code always overwrited the property, not added a new value.

if my property in the model is:

<property name="myModel:myProperty">
               <type>d:text</type>
               <mandatory>false</mandatory>
               <multiple>true</multiple>
</property>
How can add the value on the webscript?

And I have another question, can I refresh the uicontext through webscript?something like the method "contextUpdated" on browsebean?

Thanks in advanced,
Ana
1 REPLY 1

anusk
Champ in-the-making
Champ in-the-making
I answer myself,

To update the multi valued property you must use an array
Something like this



var array = new Array();
array = content.properties["myModel:myProperty"];
var index_arr= array .length;
array [index_arr]=new_property;
content.properties["myModel:myProperty"]=array ;

Hope that someone find it useful.

Regards,
Ana