PDA

View Full Version : Save by a RIA service post with array as parameter



sreenatht
20 Apr 2012, 6:56 AM
How to post a RIA serviec call form Extjs with array value as parameter
setting the array
var optionPnl = Ext.getCmp('OptionsTreePnl');
for (i = 0; i < optionPnl.getRootNode().childNodes.length; i++) {
var item = { "__type": "QstQuestionElementAttributesDTO:#My.App1.Questionnaire.Common.Objects",
"Name": optionPnl.getRootNode().childNodes[0].data.text
};
elementAtributes.push(item);
}
like below I am setting parameters


var changeSet = [];
var entityChange = {};

//Setting Id for entityChange, not the entity key but how the changeset tracks each change if there is more than one
entityChange.Id = 0;
entityChange.Entity = { "__type": "QuestionDTO:#My.App1.Questionnaire.Common.Objects",
"Id": 1,
"Label": this.items.items[1].value,
"LabelResId": 1,
"PageId": Ext.getCmp('center-region').getActiveTab().getId().split('_')[1],
"ToolTip": (this.items.items[4].value == null) ? "" : this.items.items[4].value,
"TooltipResId": 1,
"Sort": 1,
"TResId": 1,
"QstId": gloabalQstnrVars.QstnrId,
"SectionId": 1,
"CreatedById": 1,
"UpdatedById": 1,
"SeqNum": 1,
"ControlTypeId": this.items.items[0].value,
"QEAttributes": elementAtributes,
"DataType": "VARCHAR(255)",
"MaxLength": 1000,
"IsRequired": this.items.items[3].items.items[2].checked,
"IsReportable": this.items.items[3].items.items[0].checked,
"IsExportable": this.items.items[3].items.items[1].checked,
"IsEnabled": this.items.items[3].items.items[3].checked,
"Width": this.items.items[2].value
};



The below is the array parameter I am sending in the above list

"QEAttributes": elementAtributes,


How to post it? Please help