view tests/megaform.ur @ 1908:ab1a3737b306

make clean: Clean bin/mlton, src/urweb.mlton.lex, src/urweb.mlton.grm Signed-off-by: Anders Kaseorg <andersk@mit.edu> --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
author Anders Kaseorg <andersk@mit.edu>
date Fri, 22 Nov 2013 09:36:14 -0500
parents 21f6d2e65685
children
line wrap: on
line source
fun handler'' ls =
    case ls of
        Nil => <xml/>
      | Cons (r, ls) => <xml><li>{[r.C]}</li>{handler'' ls}</xml>

fun handler' ls =
    case ls of
        Nil => <xml/>
      | Cons (r, ls) => <xml><li>{[r.Sub.A]} <ul>{handler'' r.Sub.Sub2}</ul></li>{handler' ls}</xml>

fun handler r = return <xml><body>
  {[r.A]}
  <ul>{handler' r.Sub}</ul>
  {[r.C]}<br/>
  {[r.Sub2.A]}<br/>
  {handler'' r.Sub2.Nested}
</body></xml>

fun main () = return <xml><body>
  <form>
    <textbox{#A}/><br/>
    <subforms{#Sub}>
      <entry>
        <subform{#Sub}>
          <textbox{#A}/><br/>
          <subforms{#Sub2}>
            <entry>
              <textbox{#C}/><br/>
            </entry>

            <entry>
              <textbox{#C}/><br/>
            </entry>
          </subforms>
        </subform>
      </entry>

      <entry>
        <subform{#Sub}>
          <textbox{#A}/><br/>
          <subforms{#Sub2}>
            <entry>
              <textbox{#C}/><br/>
            </entry>

            <entry>
              <textbox{#C}/><br/>
            </entry>
          </subforms>
        </subform>
      </entry>
    </subforms>
    <textbox{#C}/><br/>

    <subform{#Sub2}>
      <textbox{#A}/><br/>

      <subforms{#Nested}>
        <entry>
          <textbox{#C}/>
        </entry>
      </subforms>
    </subform><br/>

    <submit action={handler}/>
  </form>
</body></xml>