diff demo/crud3.ur @ 781:c884a42599f3

crud3 demo
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 May 2009 16:00:43 -0400
parents
children 669ac5e9a69e
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/demo/crud3.ur	Sun May 03 16:00:43 2009 -0400
@@ -0,0 +1,27 @@
+table t : {Id : int, Text : string}
+  PRIMARY KEY Id
+
+open Crud.Make(struct
+                   val tab = t
+                             
+                   val title = "Crud3"
+
+                   val cols = {Text = {Nam = "Text",
+                                       Show = txt,
+                                       Widget = (fn (nm :: Name) => <xml>
+                                         <subform{nm}>
+                                           <textbox{#A}/>
+                                           <textbox{#B}/>
+                                         </subform>
+                                       </xml>),
+                                       WidgetPopulated = (fn (nm :: Name) s => <xml>
+                                         <subform{nm}>
+                                           <textbox{#A} value={s}/>
+                                           <textbox{#B}/>
+                                         </subform>
+                                       </xml>),
+                                       Parse = (fn p => p.A ^ p.B),
+                                       Inject = _
+                                      }
+                              }
+               end)