summaryrefslogtreecommitdiff
path: root/demo/more/grid1.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-09-12 15:08:16 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-09-12 15:08:16 -0400
commit640e40ca6ce43e920e77187f653a86935e9d0acb (patch)
treeb14cefa940085b1eb1aede8b6027107f444a1fc5 /demo/more/grid1.ur
parented87f01d25f0b60baa02f9613f6b479cf948e36b (diff)
Nullable columns *might* be working, but too much JS is generated for the page to load in finite time
Diffstat (limited to 'demo/more/grid1.ur')
-rw-r--r--demo/more/grid1.ur11
1 files changed, 7 insertions, 4 deletions
diff --git a/demo/more/grid1.ur b/demo/more/grid1.ur
index a62d7819..4d0fe1bf 100644
--- a/demo/more/grid1.ur
+++ b/demo/more/grid1.ur
@@ -4,11 +4,11 @@ table t1 : {Id : int, A : string}
PRIMARY KEY Id
sequence s
-table t : {Id : int, A : int, B : string, C : bool, D : int}
+table t : {Id : int, A : int, B : string, C : bool, D : int, E : option int}
PRIMARY KEY Id,
CONSTRAINT Foreign FOREIGN KEY (D) REFERENCES t1(Id) ON DELETE CASCADE
-fun page (n, s) = return <xml>A = {[n]}, B = {[s]}</xml>
+(*fun page (n, s) = return <xml>A = {[n]}, B = {[s]}</xml>*)
open Make(struct
val tab = t
@@ -23,6 +23,8 @@ open Make(struct
C = {New = return False,
Inj = _},
D = {New = return 0,
+ Inj = _},
+ E = {New = return None,
Inj = _}}
structure F = Direct.Foreign(struct
@@ -34,10 +36,11 @@ open Make(struct
val cols = {Id = Direct.readOnly [#Id] ! "Id" Direct.int,
A = Direct.editable [#A] ! "A" Direct.int,
B = Direct.editable [#B] ! "B" Direct.string,
- C = Direct.editable [#C] ! "C" Direct.bool,
+ C = Direct.editable [#C] ! "C" Direct.bool(*,
D = Direct.editable [#D] ! "D" F.meta,
+ E = Direct.editable [#E] ! "E" (Direct.nullable Direct.int),
DA = computed "2A" (fn r => 2 * r.A),
- Link = computedHtml "Link" (fn r => <xml><a link={page (r.A, r.B)}>Go</a></xml>)}
+ Link = computedHtml "Link" (fn r => <xml><a link={page (r.A, r.B)}>Go</a></xml>)*)}
end)
fun main () =