Mercurial > urweb
annotate tests/rpcN.ur @ 2153:39bd1d4007a9
Apply syntax sugar for 'class' attribute to <form> as well
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Mon, 08 Jun 2015 11:11:46 -0400 |
parents | 5891f47d7cff |
children |
rev | line source |
---|---|
adamc@614 | 1 table t : { A : int } |
adamc@614 | 2 |
adamc@614 | 3 fun main () : transaction page = |
adamc@614 | 4 let |
adamc@614 | 5 fun count a = r <- oneRow (SELECT COUNT( * ) AS N FROM t WHERE t.A = {[a]}); |
adamc@614 | 6 return r.N |
adamc@614 | 7 in |
adamc@614 | 8 s <- source 0; |
adamc@614 | 9 return <xml><body> |
adamc@614 | 10 <button value="Get It On!" |
adamc@614 | 11 onclick={n <- count 3; |
adamc@614 | 12 set s n}/><br/> |
adamc@614 | 13 <br/> |
adamc@614 | 14 Current: <dyn signal={n <- signal s; return <xml>{[n]}</xml>}/> |
adamc@614 | 15 </body></xml> |
adamc@614 | 16 end |