Mercurial > urweb
comparison tests/crud1.ur @ 350:3a1e36b14105
First sort-of-working run of urweb-mode
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 12 Oct 2008 10:04:17 -0400 |
parents | beb72f8a7218 |
children | 9390c55b9f1f |
comparison
equal
deleted
inserted
replaced
349:beb72f8a7218 | 350:3a1e36b14105 |
---|---|
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 | 2 |
3 open Crud.Make(struct | 3 open Crud.Make(struct |
4 val tab = t1 | 4 val tab = t1 |
5 | 5 |
6 val title = "Crud1" | 6 val title = "Crud1" |
7 | 7 |
8 val cols = { | 8 val cols = { |
9 A = { | 9 A = {Nam = "A", |
10 Nam = "A", | 10 Show = txt _, |
11 Show = txt _, | 11 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, |
12 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, | 12 WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>, |
13 WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>, | 13 Parse = readError _, |
14 Parse = readError _, | 14 Inject = _}, |
15 Inject = _ | 15 B = {Nam = "B", |
16 }, | 16 Show = txt _, |
17 B = { | 17 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, |
18 Nam = "B", | 18 WidgetPopulated = fn (nm :: Name) s => <lform><textbox{nm} value={s}/></lform>, |
19 Show = txt _, | 19 Parse = readError _, |
20 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, | 20 Inject = _ |
21 WidgetPopulated = fn (nm :: Name) s => <lform><textbox{nm} value={s}/></lform>, | 21 }, |
22 Parse = readError _, | 22 C = {Nam = "C", |
23 Inject = _ | 23 Show = txt _, |
24 }, | 24 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, |
25 C = { | 25 WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>, |
26 Nam = "C", | 26 Parse = readError _, |
27 Show = txt _, | 27 Inject = _ |
28 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, | 28 }, |
29 WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>, | 29 D = {Nam = "D", |
30 Parse = readError _, | 30 Show = txt _, |
31 Inject = _ | 31 Widget = fn nm :: Name => <lform><checkbox{nm}/></lform>, |
32 }, | 32 WidgetPopulated = fn (nm :: Name) b => <lform><checkbox{nm} checked={b}/></lform>, |
33 D = { | 33 Parse = fn x => x, |
34 Nam = "D", | 34 Inject = _} |
35 Show = txt _, | 35 } |
36 Widget = fn nm :: Name => <lform><checkbox{nm}/></lform>, | 36 end) |
37 WidgetPopulated = fn (nm :: Name) b => <lform><checkbox{nm} checked={b}/></lform>, | |
38 Parse = fn x => x, | |
39 Inject = _ | |
40 } | |
41 } | |
42 end) |