Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Costumize Restfultable with Multiple select

Janik Bürgermeister
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 27, 2020

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?

1 answer

0 votes
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 4, 2020

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events