Skip to content

Commit

Permalink
FELIX-6614 WebConsole configMgr saves an empty value in list properit…
Browse files Browse the repository at this point in the history
…es (#212)

* FELIX-6614 WebConsole configMgr saves an empty value in list properites

* FELIX-6614 WebConsole configMgr saves an empty value in list properites

---------

Co-authored-by: Sagar Miglani <saga@adobe.com>
  • Loading branch information
sagarmiglani and Sagar Miglani committed Jul 20, 2023
1 parent 877a9e1 commit be219c7
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/main/resources/res/ui/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,11 @@ function printForm( /* Element */ parent, /* Object */ properties, additionalPro
}
else if (attr.values.length == 0)
{
tdEl.appendChild( createSpan( prop, "", attr.type ) );
tdEl.appendChild( createAddButton( prop) );
}
else
{
tdEl.appendChild( createAddButton( prop) );
for (var i=0;i<attr.values.length;i++)
{
tdEl.appendChild( createSpan( prop, attr.values[i], attr.type ) );
Expand Down Expand Up @@ -348,6 +349,25 @@ function printConfigurationInfo( /* Element */ parent, obj )


var spanCounter = 0;
/* Element */ function createAddButton(prop) {
spanCounter++;
var newId = prop + spanCounter;

var addButton = createElement("input", null,
{ type: "button",
style: {width : "5%"},
value: "+"
}
);
$(addButton).click(function() {
addValue(prop, newId);
});

return createElement( "span", null, { id: newId }, [
createElement("span", null, { style: { display: "inline-block", width: '94%'} } ), addButton,
createElement("br")
]);
}
/* Element */ function createSpan(prop, value, type) {
spanCounter++;
var newId = prop + spanCounter;
Expand Down Expand Up @@ -762,4 +782,4 @@ $(document).ready(function() {
if(factoryCreate) configure(selectedPid, true);
else configure(selectedPid);
}
});
});

0 comments on commit be219c7

Please sign in to comment.