<%@ taglib uri="/hawtags" prefix="haw" %>
<!-- 
  HAWHAW example for haw:select haw:option and haw:hidden
  Norbert Huffschmid
  $Date: 2007/12/05 22:10:57 $
-->
<haw:haw>
  <haw:deck title="Example 5">

  <% if (request.getParameter("pass") == null) { %>

    <haw:form action="<%= request.getRequestURL().toString() %>">
      <haw:text>What do you want to eat?</haw:text>
      <haw:select name="input1" type="popup">
        <haw:option label="Pizza" value="pizza"/>
        <haw:option label="Sushi" value="sushi"/>
        <haw:option label="Pasta" value="pasta"/>
        <haw:option label="Sandwich" value="sandwich"/>
      </haw:select>
      <haw:hidden name="pass" value="2"/>
      <haw:submit label="Continue"/>
    </haw:form>

  <% }
     else if (request.getParameter("pass").equals("2")) { %>

    <haw:form action="<%= request.getRequestURL().toString() %>">
      <haw:text>And what do you want to drink?</haw:text>
      <haw:select name="input2" type="spin">
        <haw:option label="Coke" value="coke"/>
        <haw:option label="Beer" value="beer"/>
        <haw:option label="Wine" value="wine"/>
      </haw:select>
      <haw:hidden name="input1" value="<%= request.getParameter("input1") %>"/>
      <haw:hidden name="pass" value="3"/>
      <haw:submit label="Continue"/>
    </haw:form>

  <% }
     else { %>

    <haw:text bold="yes">You ordered <%= request.getParameter("input1") %> with <%= request.getParameter("input2") %>.</haw:text>
    <haw:text>Your order will arrive in 30 minutes.</haw:text>

  <% } %>

  </haw:deck>
</haw:haw>