diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-10-14 17:18:59 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-10-14 17:18:59 -0400 |
commit | ed10a428abc7be47f8cce83db8dc64ac3cb6e84b (patch) | |
tree | b7617266b4a9f49dec81d71cdb6c762172f706d6 /tests/crud1.ur | |
parent | 8f64fda22cf9820a07c251acf755e14c836020a8 (diff) |
Reusable column handlers for Crud
Diffstat (limited to 'tests/crud1.ur')
-rw-r--r-- | tests/crud1.ur | 40 |
1 files changed, 4 insertions, 36 deletions
diff --git a/tests/crud1.ur b/tests/crud1.ur index 80b2b103..3849e822 100644 --- a/tests/crud1.ur +++ b/tests/crud1.ur @@ -1,44 +1,12 @@ table t1 : {Id : int, A : int, B : string, C : float, D : bool} -val a = {Nam = "A", - Show = txt _, - Widget = fn nm :: Name => <xml><textbox{nm}/></xml>, - WidgetPopulated = fn (nm :: Name) n => - <xml><textbox{nm} value={show _ n}/></xml>, - Parse = readError _, - Inject = _} - -val b = {Nam = "B", - Show = txt _, - Widget = fn nm :: Name => <xml><textbox{nm}/></xml>, - WidgetPopulated = fn (nm :: Name) s => - <xml><textbox{nm} value={s}/></xml>, - Parse = readError _, - Inject = _} - -val c = {Nam = "C", - Show = txt _, - Widget = fn nm :: Name => <xml><textbox{nm}/></xml>, - WidgetPopulated = fn (nm :: Name) n => - <xml><textbox{nm} value={show _ n}/></xml>, - Parse = readError _, - Inject = _} - -val d = {Nam = "D", - Show = txt _, - Widget = fn nm :: Name => <xml><checkbox{nm}/></xml>, - WidgetPopulated = fn (nm :: Name) b => - <xml><checkbox{nm} checked={b}/></xml>, - Parse = fn x => x, - Inject = _} - open Crud.Make(struct val tab = t1 val title = "Crud1" - val cols = {A = a, - B = b, - C = c, - D = d} + val cols = {A = Crud.int "A", + B = Crud.string "B", + C = Crud.float "C", + D = Crud.bool "D"} end) |