Mercurial > urweb
comparison demo/batch.ur @ 1784:e6bc6bbd7a32
Update demo code for key/mouse handler change
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sat, 21 Jul 2012 10:12:35 -0400 |
parents | ed06e25c70ef |
children |
comparison
equal
deleted
inserted
replaced
1783:5bc4fbf9c0fe | 1784:e6bc6bbd7a32 |
---|---|
23 fun show' ls = | 23 fun show' ls = |
24 case ls of | 24 case ls of |
25 Nil => <xml/> | 25 Nil => <xml/> |
26 | Cons ((id, a), ls) => <xml> | 26 | Cons ((id, a), ls) => <xml> |
27 <tr><td>{[id]}</td> <td>{[a]}</td> {if withDel then | 27 <tr><td>{[id]}</td> <td>{[a]}</td> {if withDel then |
28 <xml><td><button value="Delete" onclick={rpc (del id)}/> | 28 <xml><td><button value="Delete" onclick={fn _ => rpc (del id)}/> |
29 </td></xml> | 29 </td></xml> |
30 else | 30 else |
31 <xml/>} </tr> | 31 <xml/>} </tr> |
32 {show' ls} | 32 {show' ls} |
33 </xml> | 33 </xml> |
62 return <xml><body> | 62 return <xml><body> |
63 <h2>Rows</h2> | 63 <h2>Rows</h2> |
64 | 64 |
65 {show True lss} | 65 {show True lss} |
66 | 66 |
67 <button value="Update" onclick={ls <- rpc (allRows ()); set lss ls}/><br/> | 67 <button value="Update" onclick={fn _ => ls <- rpc (allRows ()); set lss ls}/><br/> |
68 <br/> | 68 <br/> |
69 | 69 |
70 <h2>Batch new rows to add</h2> | 70 <h2>Batch new rows to add</h2> |
71 | 71 |
72 <table> | 72 <table> |
73 <tr> <th>Id:</th> <td><ctextbox source={id}/></td> </tr> | 73 <tr> <th>Id:</th> <td><ctextbox source={id}/></td> </tr> |
74 <tr> <th>A:</th> <td><ctextbox source={a}/></td> </tr> | 74 <tr> <th>A:</th> <td><ctextbox source={a}/></td> </tr> |
75 <tr> <th/> <td><button value="Batch it" onclick={add ()}/></td> </tr> | 75 <tr> <th/> <td><button value="Batch it" onclick={fn _ => add ()}/></td> </tr> |
76 </table> | 76 </table> |
77 | 77 |
78 <h2>Already batched:</h2> | 78 <h2>Already batched:</h2> |
79 {show False batched} | 79 {show False batched} |
80 <button value="Execute" onclick={exec ()}/> | 80 <button value="Execute" onclick={fn _ => exec ()}/> |
81 </body></xml> | 81 </body></xml> |
82 end | 82 end |