annotate tests/crud1.ur @ 349:beb72f8a7218

Expand cases where expression wildcards are allowed
author Adam Chlipala <adamc@hcoop.net>
date Sat, 04 Oct 2008 20:05:50 -0400
parents b88f4297167f
children 3a1e36b14105
rev   line source
adamc@325 1 table t1 : {Id : int, A : int, B : string, C : float, D : bool}
adamc@325 2
adamc@325 3 open Crud.Make(struct
adamc@325 4 val tab = t1
adamc@325 5
adamc@325 6 val title = "Crud1"
adamc@325 7
adamc@325 8 val cols = {
adamc@339 9 A = {
adamc@339 10 Nam = "A",
adamc@339 11 Show = txt _,
adamc@339 12 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
adamc@341 13 WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>,
adamc@339 14 Parse = readError _,
adamc@349 15 Inject = _
adamc@339 16 },
adamc@339 17 B = {
adamc@339 18 Nam = "B",
adamc@339 19 Show = txt _,
adamc@339 20 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
adamc@341 21 WidgetPopulated = fn (nm :: Name) s => <lform><textbox{nm} value={s}/></lform>,
adamc@339 22 Parse = readError _,
adamc@349 23 Inject = _
adamc@339 24 },
adamc@339 25 C = {
adamc@339 26 Nam = "C",
adamc@339 27 Show = txt _,
adamc@339 28 Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
adamc@341 29 WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>,
adamc@339 30 Parse = readError _,
adamc@349 31 Inject = _
adamc@339 32 },
adamc@339 33 D = {
adamc@339 34 Nam = "D",
adamc@339 35 Show = txt _,
adamc@347 36 Widget = fn nm :: Name => <lform><checkbox{nm}/></lform>,
adamc@347 37 WidgetPopulated = fn (nm :: Name) b => <lform><checkbox{nm} checked={b}/></lform>,
adamc@347 38 Parse = fn x => x,
adamc@349 39 Inject = _
adamc@339 40 }
adamc@325 41 }
adamc@325 42 end)