This is an automated email from the ASF dual-hosted git repository.

cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git


The following commit(s) were added to refs/heads/master by this push:
     new 9819a6e80a FELIX-6614 WebConsole configMgr saves an empty value in 
list properites (#212)
9819a6e80a is described below

commit 9819a6e80a1e25ec909c092b2619bed34c3130d3
Author: Sagar Miglani <[email protected]>
AuthorDate: Thu Jul 20 10:25:14 2023 +0530

    FELIX-6614 WebConsole configMgr saves an empty value in list properites 
(#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 <[email protected]>
---
 webconsole/src/main/resources/res/ui/config.js | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/webconsole/src/main/resources/res/ui/config.js 
b/webconsole/src/main/resources/res/ui/config.js
index a26113aef7..c7c283a4c2 100644
--- a/webconsole/src/main/resources/res/ui/config.js
+++ b/webconsole/src/main/resources/res/ui/config.js
@@ -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 
) );
@@ -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;
@@ -762,4 +782,4 @@ $(document).ready(function() {
          if(factoryCreate) configure(selectedPid, true);
          else configure(selectedPid);
        }
-});
\ No newline at end of file
+});

Reply via email to