diff demo/more/grid1.ur @ 931:be6585b4058b

Have nullable columns working with Dbgrid
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Sep 2009 12:00:34 -0400
parents 51bc7681c47e
children 0a156bbd205f
line wrap: on
line diff
--- a/demo/more/grid1.ur	Sat Sep 12 15:08:16 2009 -0400
+++ b/demo/more/grid1.ur	Sun Sep 13 12:00:34 2009 -0400
@@ -4,7 +4,7 @@
   PRIMARY KEY Id
 
 sequence s
-table t : {Id : int, A : int, B : string, C : bool, D : int, E : option int}
+table t : {Id : int, A : int, B : string, C : bool, D : int, E : option int, F : option int}
   PRIMARY KEY Id,
   CONSTRAINT Foreign FOREIGN KEY (D) REFERENCES t1(Id) ON DELETE CASCADE
 
@@ -25,6 +25,8 @@
                          D = {New = return 0,
                               Inj = _},
                          E = {New = return None,
+                              Inj = _},
+                         F = {New = return None,
                               Inj = _}}
 
               structure F = Direct.Foreign(struct
@@ -34,11 +36,12 @@
                                            end)
 
               val cols = {Id = Direct.readOnly [#Id] ! "Id" Direct.int,
-                          A = Direct.editable [#A] ! "A" Direct.int,
+                          (*A = Direct.editable [#A] ! "A" Direct.int,
                           B = Direct.editable [#B] ! "B" Direct.string,
-                          C = Direct.editable [#C] ! "C" Direct.bool(*,
-                          D = Direct.editable [#D] ! "D" F.meta,
+                          C = Direct.editable [#C] ! "C" Direct.bool,
+                          D = Direct.editable [#D] ! "D" F.meta,*)
                           E = Direct.editable [#E] ! "E" (Direct.nullable Direct.int),
+                          F = Direct.editable [#F] ! "F" (Direct.nullable F.meta)(*,
                           DA = computed "2A" (fn r => 2 * r.A),
                           Link = computedHtml "Link" (fn r => <xml><a link={page (r.A, r.B)}>Go</a></xml>)*)}
           end)