comparison tests/crud1.ur @ 353:9390c55b9f1f

More indenting
author Adam Chlipala <adamc@hcoop.net>
date Sun, 12 Oct 2008 10:48:01 -0400
parents 3a1e36b14105
children c1e96b387115
comparison
equal deleted inserted replaced
352:2205d5cb416a 353:9390c55b9f1f
1 table t1 : {Id : int, A : int, B : string, C : float, D : bool} 1 table t1 : {Id : int, A : int, B : string, C : float, D : bool}
2
3 val a = {Nam = "A",
4 Show = txt _,
5 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
6 WidgetPopulated = fn (nm :: Name) n =>
7 <lform><textbox{nm} value={show _ n}/></lform>,
8 Parse = readError _,
9 Inject = _}
10
11 val b = {Nam = "B",
12 Show = txt _,
13 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
14 WidgetPopulated = fn (nm :: Name) s =>
15 <lform><textbox{nm} value={s}/></lform>,
16 Parse = readError _,
17 Inject = _}
18
19 val c = {Nam = "C",
20 Show = txt _,
21 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
22 WidgetPopulated = fn (nm :: Name) n =>
23 <lform><textbox{nm} value={show _ n}/></lform>,
24 Parse = readError _,
25 Inject = _}
26
27 val d = {Nam = "D",
28 Show = txt _,
29 Widget = fn nm :: Name => <lform><checkbox{nm}/></lform>,
30 WidgetPopulated = fn (nm :: Name) b =>
31 <lform><checkbox{nm} checked={b}/></lform>,
32 Parse = fn x => x,
33 Inject = _}
2 34
3 open Crud.Make(struct 35 open Crud.Make(struct
4 val tab = t1 36 val tab = t1
5 37
6 val title = "Crud1" 38 val title = "Crud1"
7 39
8 val cols = { 40 val cols = {A = a,
9 A = {Nam = "A", 41 B = b,
10 Show = txt _, 42 C = c,
11 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, 43 D = d}
12 WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>,
13 Parse = readError _,
14 Inject = _},
15 B = {Nam = "B",
16 Show = txt _,
17 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
18 WidgetPopulated = fn (nm :: Name) s => <lform><textbox{nm} value={s}/></lform>,
19 Parse = readError _,
20 Inject = _
21 },
22 C = {Nam = "C",
23 Show = txt _,
24 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
25 WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>,
26 Parse = readError _,
27 Inject = _
28 },
29 D = {Nam = "D",
30 Show = txt _,
31 Widget = fn nm :: Name => <lform><checkbox{nm}/></lform>,
32 WidgetPopulated = fn (nm :: Name) b => <lform><checkbox{nm} checked={b}/></lform>,
33 Parse = fn x => x,
34 Inject = _}
35 }
36 end) 44 end)