<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib tagdir="/WEB-INF/tags" prefix="st"%>
<%@taglib uri="/japano" prefix="jpn"%>
<%@taglib uri="/user" prefix="usr"%>
<st:page title="edit user ${session.user}">
  <usr:change id="formEdit">
    <h3>Edit User&nbsp;<usr:change.user.id/></h3>    
    <jpn:messageList/>
    <dl>
      <dt>Alias</dt><dd><usr:change.user.alias/></dd>
      <dt>EMail</dt><dd><usr:change.user.EMail/></dd>
      <dt>Gender</dt><dd><usr:change.user.gender-female/> Female<br><usr:change.user.gender-male/> Male</dd>
      <dt>Email Settings</dt><dd><usr:change.user.secretEmail size="1"/></dd>    
      <dt>Biography</dt><dd><usr:change.user.bio cols="40" rows="5"/></dd>
      <dt>Operating System</dt><dd>Choose an operating system from the List<br><usr:change.user.operatingSystem size="5"/><p>or enter new operating system&nbsp;<usr:change.newSystem/></dd>    
    </dl>
    <p>
    <p>
    <usr:change.submit class="button" text="change user data"/>&nbsp;&nbsp;<usr:logout class="button">Log out</usr:logout>&nbsp;&nbsp;<input class="button" type="reset" value="Reset"> 
  </usr:change> 
  <div class="info">
  This action invocation form changes the data of the user currently logged in. 
  This view is selected by the ShowUser action if it is invoked without user id and a user is logged in.      
  <p>
  The form is a complex action with dynamic defaults which contains the User class as a nested bean.      
  The form fields are configured via japano tags in the User class but could also be configured via
  japano tags in the bean accessor method of the action class 
  (<a href="/org/japanosample/action/ChangeUser.java.html" title="source code of org.japanosample.action.ChangeUser">ChangeUser#getUser</a>).      
  Note the additional <strong>@japano.bean</strong> tag on this method which is needed to activate the bean field creation
  and to ignore the password and passwordHash property of the User class for field creation.
  <p>
  The operating system select field uses a dynamic list of operating systems. New items can be added
  to the operating system list via an newSystem input field. (This also demonstrates how to mix 
  nested bean form fields and action form fields).      <p>
  <b>Note:</b>
  Using the redirectAfterPOST feature makes it possible that this form is a POST form but
  the resulting page is retrieved via the GET method so that it can be reloaded without
  any browser warnings.
  <p>
  Sourcecode:
  <ul>
    <li><a href="editUser.jsp.html">Source code of the edit user view</a></li>
    <li><a href="org/japanosample/action/ShowUser.java.html">Source Code of the ShowUser action</a></li>
    <li><a href="org/japanosample/action/ChangeUser.java.html">Source Code of the ChangeUser action</a></li>
    <li><a href="org/japanosample/action/Logout.java.html">Source Code of the Logout action</a></li>
    <li><a href="org/japanosample/User.java.html">Source Code of the User class</a></li>
    <li><a href="org/japanosample/SampleSession.java.html">Source Code of the SampleSession class</a></li>
  </ul>
</st:page>