view tests/data_attr.ur @ 2176:d2a98983f502

Start of support for surviving database-server restarts, for Postgres
author Adam Chlipala <adam@chlipala.net>
date Sat, 17 Oct 2015 10:49:25 -0400
parents 6be31671911b
children
line wrap: on
line source
fun dynd r = return <xml><body>
  <div data={data_attr data_kind r.Attr r.Value}>How about that?</div>
</body></xml>

fun main () : transaction page =
  s <- source <xml/>;
  a <- source "";
  v <- source "";
  return <xml><body>
    <div data-foo="hi" aria-something="wow" data-bar="bye" data-baz="why">Whoa there, cowboy!</div>

    <hr/>

    <form>
      <textbox{#Attr}/> = <textbox{#Value}/>
      <submit action={dynd}/>
    </form>

    <hr/>

    <ctextbox source={a}/> = <ctextbox source={v}/>
    <button onclick={fn _ =>
      a <- get a; v <- get v; set s <xml><div data={data_attr data_kind a v}>OHO!</div></xml>}/>
    <hr/>
    <dyn signal={signal s}/>
  </body></xml>