From 546fbca7602e2a4aa8224a3e93e707d888e359a2 Mon Sep 17 00:00:00 2001
From: ulrich <undisclosed>
Date: Tue, 20 Dec 2016 12:22:50 +0000
Subject: [PATCH] Userlist fuellen hinzugefuegt (prototypisch)

---
 web/ui/ui.js |   38 +++++++++++++++++++++++++++++++++++---
 1 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/web/ui/ui.js b/web/ui/ui.js
index 10a90dd..d24b7a8 100644
--- a/web/ui/ui.js
+++ b/web/ui/ui.js
@@ -32,8 +32,9 @@
 /* ----------- ui interaction ------------ */
 
 function um_user_list_click() {
-  var user_name = 'noch aus liste ermitteln..';
-  alert('user list click, user: ' + user_name);
+  //var user_name = 'noch aus liste ermitteln..';
+  //alert('user list click, user: ' + user_name);
+  um_get_user_list();
 }
 
 
@@ -46,7 +47,17 @@
   return user;
 }
 
-
+function um_show_user_list(resp) {
+  var users = resp.List[0];
+  for(var i = 0; i < users.List.length; i++) {
+    var user = users.List[i];
+    $("#nutzerliste").append('<option value=' + user.String + '>' + user.String + '</option>');
+  }
+  //var user1 = users.List[1];
+  //var username = user1.String;
+  //alert(username);
+  //$("#nutzerliste").append('<option value=' + UpdateItem + '>' + UpdateItem + '</option>');
+}
 
 /* ---- api calls ----- */
 
@@ -73,6 +84,27 @@
   });      
 }
 
+function um_get_user_list() {
+  var c = 'de.uhilger.um.api.UserMgr';
+  var m = 'getUserNameList';
+  var u = '../svc/' + m;
+  $.ajax({
+    url: u,
+    type: "GET",
+    dataType : "json",
+    success: function( resp ) {
+      //$('#fehler').html('Antwort: ' + resp);
+      um_show_user_list(resp);
+    },
+    error: function( xhr, status, errorThrown ) {
+      $('#fehler').html("Error: " + errorThrown + " Status: " + status);
+    },
+    complete: function( xhr, status ) {
+      //alert( "The request is complete!" );
+    }
+  });      
+}
+
 /* ----- Hilfsfunktionen ----- */
 
 function serialisieren(obj) {

--
Gitblit v1.9.3