aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/activeFocus.ur
blob: 94d465e90e66935c2d406e821a06e82f0e7f12f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fun main () : transaction page =
    i <- fresh;
    return <xml><body>
      <ctextbox/>
      <ctextbox id={i}/>
      <active code={giveFocus i; return <xml>Done</xml>}/>
    </body></xml>

fun dynamic () : transaction page =
    x <- source <xml/>;
    return <xml><body>
      <dyn signal={signal x}/>
      <button onclick={fn _ => i <- fresh; set x <xml>
        <ctextbox/>
        <ctextbox id={i}/>
        <active code={giveFocus i; return <xml>Done</xml>}/>
      </xml>}/>
    </body></xml>