diff options
author | 2018-06-04 11:51:00 -0400 | |
---|---|---|
committer | 2018-06-04 11:51:00 -0400 | |
commit | e626ef35ebd7d79a820ead03a8d30d5ee090671c (patch) | |
tree | 1f1a2129eff0d6e99f18ec96707720ce30d411ef /tests/cradio.ur | |
parent | c68da19be2a3fab584973c4a9d0a93035a6d9116 (diff) | |
parent | 71dab68defc48d9be9d1e45e63925d0fb01ebb34 (diff) |
Merge branch 'master' of ssh://github.com/urweb/urweb
Diffstat (limited to 'tests/cradio.ur')
-rw-r--r-- | tests/cradio.ur | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/cradio.ur b/tests/cradio.ur new file mode 100644 index 00000000..48c04f1e --- /dev/null +++ b/tests/cradio.ur @@ -0,0 +1,26 @@ +fun main () = +s <- source (Some "B"); +r <- source None; +let + val onc = v <- get s; alert ("Now it's " ^ show v) + val onc_r = v <- get r; alert ("Changed to " ^ show v) +in + return <xml><body> + <h1>First group</h1> + + <label>Wilbur <cradio source={s} value="A" onchange={onc}/></label> + <label>Walbur <cradio source={s} value="B" onchange={onc}/></label> + + <div> + Hello, I'm <dyn signal={s <- signal s; return <xml>{[s]}</xml>}/>. I'll be your waiter for this evening. + </div> + + <h1>Second group</h1> + + <label>X <cradio source={r} value="X" onchange={onc_r}/></label> + <label>Y <cradio source={r} value="Y" onchange={onc_r}/></label> + <label>Z <cradio source={r} value="Z" onchange={onc_r}/></label> + + <div>Value: <dyn signal={r <- signal r; return <xml>{[r]}</xml>}/></div> + </body></xml> +end |