Mercurial > urweb
comparison demo/batchFun.ur @ 908:ed06e25c70ef
Convert to requiring explicit 'rpc' marker
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 22 Aug 2009 12:55:18 -0400 |
parents | 74e9e7642f08 |
children | bb3fc575cfe7 |
comparison
equal
deleted
inserted
replaced
907:5fe49effbc83 | 908:ed06e25c70ef |
---|---|
76 (fn [nm :: Name] [p :: (Type * Type)] [rest :: {(Type * Type)}] | 76 (fn [nm :: Name] [p :: (Type * Type)] [rest :: {(Type * Type)}] |
77 [[nm] ~ rest] m v => | 77 [[nm] ~ rest] m v => |
78 <xml><td>{m.Show v}</td></xml>) | 78 <xml><td>{m.Show v}</td></xml>) |
79 [M.cols] M.fl M.cols (r -- #Id)} | 79 [M.cols] M.fl M.cols (r -- #Id)} |
80 {if withDel then | 80 {if withDel then |
81 <xml><td><button value="Delete" onclick={del r.Id}/></td></xml> | 81 <xml><td><button value="Delete" onclick={rpc (del r.Id)}/></td></xml> |
82 else | 82 else |
83 <xml/>} | 83 <xml/>} |
84 </tr> | 84 </tr> |
85 {show' ls} | 85 {show' ls} |
86 </xml> | 86 </xml> |
127 set batched (Cons ({Id = readError id} ++ vs, ls)) | 127 set batched (Cons ({Id = readError id} ++ vs, ls)) |
128 | 128 |
129 fun exec () = | 129 fun exec () = |
130 ls <- get batched; | 130 ls <- get batched; |
131 | 131 |
132 doBatch ls; | 132 rpc (doBatch ls); |
133 set batched Nil | 133 set batched Nil |
134 in | 134 in |
135 return <xml><body> | 135 return <xml><body> |
136 <h2>Rows</h2> | 136 <h2>Rows</h2> |
137 | 137 |
138 {show True lss} | 138 {show True lss} |
139 | 139 |
140 <button value="Update" onclick={ls <- allRows (); set lss ls}/><br/> | 140 <button value="Update" onclick={ls <- rpc (allRows ()); set lss ls}/><br/> |
141 <br/> | 141 <br/> |
142 | 142 |
143 <h2>Batch new rows to add</h2> | 143 <h2>Batch new rows to add</h2> |
144 | 144 |
145 <table> | 145 <table> |