Hi,
I'm trying to costumize the RestFul Table.
In particular I want to add a Checkbox with different values but they should be mapped to only one Array in the Corresponding Json. And only if they are checked.
My Javascript looks like this:
var removeEditView= AJS.RestfulTable.CustomEditView.extend({
render: function (self){
var result ="";
if(self.value !== undefined){
var names = self.value;
result+='<div class="removeFromPlanView">';
result+='<form class="aui">';
for(name in names){
if(names[name]!==""&&names[name] !==" "){
result+='<div class="checkbox">';
result +='<input class="checkbox" type="checkbox" name="removeFromPlan" value="'+names[name]+'"> </input>';
result +='<label for="checkBoxOne">' + names[name]+ '</label>';
result += '</div>';
}
};
result += '</form>';
result+='</div>';
}
var $field = AJS.$(
result
);
return $field;
}
});
The Problem is, that only the last Checkbox is in the Json:
{ removeFromPlan : "lastuser" }
If im indexing the Checkboxes:
name = removeFromPlan[i]
then they are not mapped to an Array and i can't use a parameter List<String> removeFromPlan in my RestService.
Json:
{removeFromPlan[0] : "user1" , removeFromPlan[1] : "user2"}
Furthermore, the value of a single Checkbox is always sent, even if it is not checked.
How can i fix this?