Index: graphic/ui/server/context.pli
===================================================================
--- graphic/ui/server/context.pli	(revision 7368)
+++ graphic/ui/server/context.pli	(revision 7927)
@@ -12,6 +12,7 @@
   type UIServerContext
     field Link:Stream connection
     field Str connection_id
+    field Int id_counter <- 0
     field Sem connection_sem
     field Int read_only_counter <- 0
     field Str site_name url subpath
Index: graphic/ui/server/api.pli
===================================================================
--- graphic/ui/server/api.pli	(revision 7368)
+++ graphic/ui/server/api.pli	(revision 7927)
@@ -29,6 +29,10 @@
   else
     e := utf8_encode c
 
+method c generate_id -> id
+  arg_rw UIServerContext c ; arg Str id
+  id := string c:id_counter
+  c:id_counter += 1
 
 method c tag_open tag
   arg_rw UIServerContext c ; arg Ident tag
@@ -294,7 +298,7 @@
 
 method c input_data_tag label flags id focus help d
   arg_rw UIServerContext c ; arg Str label ; arg Int flags ; arg CBool focus ; arg Str id help ; arg Data_ d
-  var Str var_id := shunt id="" generate_id id
+  var Str var_id := shunt id="" c:generate_id id
   c:connection otag "input" (string c:current_section)+" "+string:var_id
   if (d:interface get d addressof:(var Str value) Str)=failure
     value := ""
@@ -326,7 +330,7 @@
   
 method c input_var_tag label flags id focus help v
   arg_rw UIServerContext c ; arg Str label ; arg Int flags ; arg CBool focus ; arg Str id help ; arg Universal v
-  var Str var_id := shunt id="" generate_id id
+  var Str var_id := shunt id="" c:generate_id id
   c:connection otag "input" (string c:current_section)+" "+string:var_id
   var Pointer:Function f :> (entry_type addressof:v) get_generic_method to_string_index
   var Str value := to_string v "db" f
@@ -403,7 +407,7 @@
 
 method c select_data_open label flags focus help d
   arg_rw UIServerContext c ; arg Str label ; arg Int flags ; arg CBool focus ; arg Str help ; arg Data_ d
-  var Str var_id := generate_id
+  var Str var_id := c:generate_id
   c:connection oraw open (cast "select" Ident) (string c:current_section)+" "+string:var_id
   if (d:interface get d addressof:(var Str value) Str)=failure
     value := ""
@@ -432,7 +436,7 @@
 
 method c select_var_open label flags focus help v
   arg_rw UIServerContext c ; arg Str label ; arg Int flags ; arg CBool focus ; arg Str help ; arg Universal v
-  var Str var_id := generate_id
+  var Str var_id := c:generate_id
   c:connection oraw open (cast "select" Ident) (string c:current_section)+" "+string:var_id
   var Pointer:Function f :> (entry_type addressof:v) get_generic_method to_string_index
   var Str value := to_string v "db" f
@@ -534,7 +538,7 @@
 
 method c button_tag label key da help flags active selected
   arg_rw UIServerContext c ; arg Str label ; arg Str key ; arg DelayedAction da ; arg Str help ; arg Int flags ; arg CBool active selected
-  var Str button_id := generate_id
+  var Str button_id := c:generate_id
   c:connection otag "button" (shunt active (string c:current_section)+" "+string:button_id "")
   if label<>""
     c:connection oattr "label" encode:label
@@ -610,7 +614,7 @@
 
 method c link_tag label key da help
   arg_rw UIServerContext c ; arg Str label key ; arg DelayedAction da ; arg Str help
-  var Str button_id := generate_id
+  var Str button_id := c:generate_id
   c:connection otag "link" encode:label (string c:current_section)+" "+string:button_id
   if key<>""
     c:connection oattr "key" key
@@ -699,7 +703,7 @@
 
 method c hook_out_open flags -> id
   arg_rw UIServerContext c ; arg Int flags ; arg Str id
-  id := (string c:current_section)+" "+string:generate_id
+  id := (string c:current_section)+" "+string:(c:generate_id)
   c:connection oraw open (cast "hook" Ident) id flags
   c:connection oraw body
 
@@ -1285,7 +1289,7 @@
 
 method c ui_thread_start da
   arg_rw UIServerContext c ; arg DelayedAction da
-  var Str id := generate_id+(random_string 128\8)
+  var Str id := c:generate_id+(random_string 128\8)
   var UIPendingThread p
   p action := da
   p server_env_sem :> c server_env_sem

