Mercurial > urweb
diff 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 |
line wrap: on
line diff
--- a/tests/crud1.ur Sat Oct 04 20:05:50 2008 -0400 +++ b/tests/crud1.ur Sun Oct 12 10:04:17 2008 -0400 @@ -1,42 +1,36 @@ table t1 : {Id : int, A : int, B : string, C : float, D : bool} open Crud.Make(struct - val tab = t1 - - val title = "Crud1" - - val cols = { - A = { - Nam = "A", - Show = txt _, - Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, - WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>, - Parse = readError _, - Inject = _ - }, - B = { - Nam = "B", - Show = txt _, - Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, - WidgetPopulated = fn (nm :: Name) s => <lform><textbox{nm} value={s}/></lform>, - Parse = readError _, - Inject = _ - }, - C = { - Nam = "C", - Show = txt _, - Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, - WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>, - Parse = readError _, - Inject = _ - }, - D = { - Nam = "D", - Show = txt _, - Widget = fn nm :: Name => <lform><checkbox{nm}/></lform>, - WidgetPopulated = fn (nm :: Name) b => <lform><checkbox{nm} checked={b}/></lform>, - Parse = fn x => x, - Inject = _ - } - } -end) + val tab = t1 + + val title = "Crud1" + + val cols = { + A = {Nam = "A", + Show = txt _, + Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, + WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>, + Parse = readError _, + Inject = _}, + B = {Nam = "B", + Show = txt _, + Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, + WidgetPopulated = fn (nm :: Name) s => <lform><textbox{nm} value={s}/></lform>, + Parse = readError _, + Inject = _ + }, + C = {Nam = "C", + Show = txt _, + Widget = fn nm :: Name => <lform><textbox{nm}/></lform>, + WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>, + Parse = readError _, + Inject = _ + }, + D = {Nam = "D", + Show = txt _, + Widget = fn nm :: Name => <lform><checkbox{nm}/></lform>, + WidgetPopulated = fn (nm :: Name) b => <lform><checkbox{nm} checked={b}/></lform>, + Parse = fn x => x, + Inject = _} + } + end)