summaryrefslogtreecommitdiff
path: root/demo/more/bulkEdit.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-10-22 11:51:31 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-10-22 11:51:31 -0400
commit34d3f5b515acbe3e83c0f2201253a08c4dea38b6 (patch)
treec5717cddb5c35dac338b88916ed982d2263d9cbc /demo/more/bulkEdit.ur
parentd2ddd6abe74aa089e261c051b3ddf6c182dce011 (diff)
Move stuff from bulkEdit to meta
Diffstat (limited to 'demo/more/bulkEdit.ur')
-rw-r--r--demo/more/bulkEdit.ur18
1 files changed, 2 insertions, 16 deletions
diff --git a/demo/more/bulkEdit.ur b/demo/more/bulkEdit.ur
index 004c77aa..0226c3dd 100644
--- a/demo/more/bulkEdit.ur
+++ b/demo/more/bulkEdit.ur
@@ -23,25 +23,11 @@ functor Make(M : sig
open M
- fun ensql [avail] (r : $(map snd visible)) : $(map (sql_exp avail [] []) (map fst visible)) =
- map2 [meta] [snd] [fn ts :: (Type * Type) => sql_exp avail [] [] ts.1]
- (fn [ts] meta v => @sql_inject meta.Inject (meta.Parse v))
- [_] folder visible r
-
fun main () =
items <- queryX (SELECT t.{keyName}, t.{{map fst visible}} FROM t)
(fn r => <xml><entry><tr>
<hidden{keyName} value={show r.T.keyName}/>
- {useMore (foldR2 [meta] [fst] [fn cols :: {(Type * Type)} =>
- xml [Body, Form, Tr] [] (map snd cols)]
- (fn [nm :: Name] [p :: (Type * Type)] [rest :: {(Type * Type)}] [[nm] ~ rest]
- (m : meta p) v (acc : xml [Body, Form, Tr] [] (map snd rest)) =>
- <xml>
- <td>{m.WidgetPopulated [nm] v}</td>
- {useMore acc}
- </xml>)
- <xml/>
- [_] folder visible (r.T -- keyName))}
+ {useMore (allPopulatedTr visible (r.T -- keyName) folder)}
</tr></entry></xml>);
return <xml><body>
@@ -58,7 +44,7 @@ functor Make(M : sig
and save r =
List.app (fn user => dml (update [map fst visible] !
- (ensql (user -- keyName))
+ (ensql visible (user -- keyName) folder)
t
(WHERE t.{keyName} = {[readError user.keyName]}))) r.Users;
main ()