summaryrefslogtreecommitdiff
path: root/tests/dynTable.ur
blob: d73dc52c303c5ed9ea008c0441cc4dfc31236116 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
fun main () : transaction page =
    s <- source <xml/>;
    s1 <- source <xml/>;
    n <- source 0;
    return <xml><body>
      <table>
        <dyn signal={signal s}/>
        <tr> <td>Hi</td> </tr>
      </table>

      <button onclick={fn _ => v <- get n;
                          set n (v + 1);
                          set s <xml><tr> <td>Whoa!({[v]})</td> </tr></xml>}/>

      <table>
        <tr> <dyn signal={signal s1}/> </tr>
        <tr> <td>Hi!</td> </tr>
      </table>

      <button onclick={fn _ => set s1 <xml><td>Whoa!</td></xml>}/>
    </body></xml>