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?
Hi Janik,
Welcome to Atlassian Community. It's nice to meet you!
We mostly deal here with end-user and administrator questions, but if you're trying to customize Confluence in this way, or develop an add-on, you'll want to raise a question on our Developer Community, available on our Atlassian Developer Resources page.
These folks are more familiar with working with our products in that way, so you will find that you are able to get help there.
Let me know if you have any trouble.
Regards,
Shannon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.