Mercurial > urweb
comparison demo/more/dbgrid.urs @ 930:51bc7681c47e
Nullable columns *might* be working, but too much JS is generated for the page to load in finite time
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 12 Sep 2009 15:08:16 -0400 |
parents | 5e8b6fa5b48f |
children | 2422360c78a3 |
comparison
equal
deleted
inserted
replaced
929:095df8f710e0 | 930:51bc7681c47e |
---|---|
13 con colMeta = fn (row :: {Type}) (global_t :: (Type * Type)) => | 13 con colMeta = fn (row :: {Type}) (global_t :: (Type * Type)) => |
14 {Initialize : transaction global_t.1, | 14 {Initialize : transaction global_t.1, |
15 Handlers : global_t.1 -> colMeta' row global_t.2} | 15 Handlers : global_t.1 -> colMeta' row global_t.2} |
16 | 16 |
17 structure Direct : sig | 17 structure Direct : sig |
18 con metaBase = fn actual_input :: (Type * Type) => | |
19 {Display : actual_input.2 -> xbody, | |
20 Edit : actual_input.2 -> xbody, | |
21 Initialize : actual_input.1 -> transaction actual_input.2, | |
22 Parse : actual_input.2 -> signal (option actual_input.1)} | |
23 | |
24 datatype metaBoth actual input = | |
25 NonNull of metaBase (actual, input) * metaBase (option actual, input) | |
26 | Nullable of metaBase (actual, input) | |
27 | |
18 con meta = fn global_actual_input :: (Type * Type * Type) => | 28 con meta = fn global_actual_input :: (Type * Type * Type) => |
19 {Initialize : transaction global_actual_input.1, | 29 {Initialize : transaction global_actual_input.1, |
20 Handlers : global_actual_input.1 | 30 Handlers : global_actual_input.1 |
21 -> {Display : global_actual_input.3 -> xbody, | 31 -> metaBoth global_actual_input.2 global_actual_input.3} |
22 Edit : global_actual_input.3 -> xbody, | |
23 Initialize : global_actual_input.2 -> transaction global_actual_input.3, | |
24 Parse : global_actual_input.3 -> signal (option global_actual_input.2)}} | |
25 | 32 |
26 con editableState :: (Type * Type * Type) -> (Type * Type) | 33 con editableState :: (Type * Type * Type) -> (Type * Type) |
27 val editable : ts ::: (Type * Type * Type) -> rest ::: {Type} | 34 val editable : ts ::: (Type * Type * Type) -> rest ::: {Type} |
28 -> nm :: Name -> [[nm] ~ rest] => string -> meta ts | 35 -> nm :: Name -> [[nm] ~ rest] => string -> meta ts |
29 -> colMeta ([nm = ts.2] ++ rest) | 36 -> colMeta ([nm = ts.2] ++ rest) |
32 con readOnlyState :: (Type * Type * Type) -> (Type * Type) | 39 con readOnlyState :: (Type * Type * Type) -> (Type * Type) |
33 val readOnly : ts ::: (Type * Type * Type) -> rest ::: {Type} | 40 val readOnly : ts ::: (Type * Type * Type) -> rest ::: {Type} |
34 -> nm :: Name -> [[nm] ~ rest] => string -> meta ts | 41 -> nm :: Name -> [[nm] ~ rest] => string -> meta ts |
35 -> colMeta ([nm = ts.2] ++ rest) | 42 -> colMeta ([nm = ts.2] ++ rest) |
36 (readOnlyState ts) | 43 (readOnlyState ts) |
44 | |
45 val nullable : global ::: Type -> actual ::: Type -> input ::: Type | |
46 -> meta (global, actual, input) | |
47 -> meta (global, option actual, input) | |
37 | 48 |
38 type intGlobal | 49 type intGlobal |
39 type intInput | 50 type intInput |
40 val int : meta (intGlobal, int, intInput) | 51 val int : meta (intGlobal, int, intInput) |
41 | 52 |