<zk xmlns="http://www.zkoss.org/2005/zul"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">  
<?page id="simplePage" title="Simple ZK Application"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="simpleWindow"?>
 
<window id="simpleWindow" use="com.ebpm.webdemo.zk.SimpleWindow3" border="normal"
             width="800px" height="500px">
    <grid id="input">
    <rows>
    <row>* Lastname: <textbox id="lastname" value="@{simpleWindow.PersonBean.lastname}" width="300px" /></row>
    <row>* Firstname: <textbox id="firstname" value="@{simpleWindow.PersonBean.firstname}" width="300px"/></row>
    <row> Address: <textbox id="address" value="@{simpleWindow.PersonBean.address}" width="300px"/></row>
    <row> Account: <decimalbox id="account" value="@{simpleWindow.PersonBean.account}" width="50px"/></row>
    <row> Birthdate: <datebox id="birthdate" value="@{simpleWindow.PersonBean.birthdate}" format="dd.MM.yyyy"/></row>
       <row spans="2"> 
              <hbox>
                     What is your favorite color?:
                     <combobox id="color" value="@{simpleWindow.PersonBean.color}">
                            <comboitem label="Red" description="Red means Red ;-)" value="r1"/>
                            <comboitem label="Green" value="g2"/>
                            <comboitem label="Blue" value="b2"/>
                     </combobox>       
              </hbox>
       </row>
       <row spans="2"> 
          <hbox>
                     <checkbox id="married" checked="@{simpleWindow.PersonBean.married}" label="Are you married?"/>
              </hbox>
       </row>
       <row spans="2">
              <groupbox>
                     <caption label="How much do you like yourself?:"/>
                     <radiogroup id="rating" selectedItem="@{simpleWindow.PersonBean.rating}">
                            <radio value="1" label="Actually, I hate me."/>
                            <radio value="2" label="Not so much."/>
                            <radio value="3" label="I'm indifferent."/>
                            <radio value="4" label="I'm pretty neat."/>
                            <radio value="5" label="I'm totally in love with me."/>
                     </radiogroup>            
              </groupbox>
       </row>
    </rows>
    </grid>
       <separator/>
       <button id="ok" label="Submit" forward="onOK"/><button label="Cancel" onClick="Executions.sendRedirect(&quot;/index.jsp&quot;)"/>
       <separator/>
       <listbox id="personsList" model="@{simpleWindow.allPersons}">
              <listhead sizable="true">
                     <listheader label="First Name"/>
                     <listheader label="Last Name"/>
                     <listheader label="Address"/>
                     <listheader label="Account"/>
                     <listheader label="Birthdate"/>
                     <listheader label="Color"/>
                     <listheader label="Married"/>
                     <listheader label="Rating"/>
              </listhead>
              <listitem self="@{each=person}">
                     <listcell label="@{person.firstname}" />
                     <listcell label="@{person.lastname}" />
                     <listcell label="@{person.address}" />
                     <listcell label="@{person.account, converter='org.zkforge.converters.ColorNumberCustom'}">
                        <custom-attributes format="###,##0.00"/></listcell>
                     <listcell label="@{person.birthdate, converter='org.zkforge.converters.DateUser'}"/>
                     <listcell label="@{person.color}" />
                     <listcell label="@{person.married, converter='org.zkforge.converters.BooleanImage'}"/>
                     <listcell label="@{person.rating}" />
              </listitem>
       </listbox>
</window>

</zk>