comparison tests/crud1.ur @ 347:58eeeb3cbf40

Use checkbox in CRUD example
author Adam Chlipala <adamc@hcoop.net>
date Sat, 04 Oct 2008 16:15:13 -0400
parents 389399d65331
children b88f4297167f
comparison
equal deleted inserted replaced
346:a94a79820d49 347:58eeeb3cbf40
3 open Crud.Make(struct 3 open Crud.Make(struct
4 con cols :: {(Type * Type)} = [ 4 con cols :: {(Type * Type)} = [
5 A = (int, string), 5 A = (int, string),
6 B = (string, string), 6 B = (string, string),
7 C = (float, string), 7 C = (float, string),
8 D = (bool, string) 8 D = (bool, bool)
9 ] 9 ]
10 10
11 val tab = t1 11 val tab = t1
12 12
13 val title = "Crud1" 13 val title = "Crud1"
38 Inject = sql_float 38 Inject = sql_float
39 }, 39 },
40 D = { 40 D = {
41 Nam = "D", 41 Nam = "D",
42 Show = txt _, 42 Show = txt _,
43 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, 43 Widget = fn nm :: Name => <lform><checkbox{nm}/></lform>,
44 WidgetPopulated = fn (nm :: Name) b => <lform><textbox{nm} value={show _ b}/></lform>, 44 WidgetPopulated = fn (nm :: Name) b => <lform><checkbox{nm} checked={b}/></lform>,
45 Parse = readError _, 45 Parse = fn x => x,
46 Inject = sql_bool 46 Inject = sql_bool
47 } 47 }
48 } 48 }
49 end) 49 end)