Commits

plightbo  committed 16c2255

shitload of bug fixes and stuff. Highlights are:
* upgraded to oscore 2.2.4 to fix NPE problem
* upgraded to final ognl 2.6.5
* reloading resource bundles (in the ghetto-fabulous way) option placed in XWork
* themes and templates now done just like 1.x
* UI label attr no longer required
* simple theme is now extended by the xhtml theme for all you "bare-bones" kids
* namespace attribute in ww:action tag is evaluated
* name attr is no longer doulbe evaluated for the form tag

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@393573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits e92de2d

Comments (0)

Files changed (74)

     <orderEntry type="module-library">
       <library>
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/core/oscore-2.2.3.jar!/" />
+          <root url="jar://$MODULE_DIR$/lib/core/ognl-2.6.5.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
     <orderEntry type="module-library">
       <library>
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/core/ognl-2.6.5.jar!/" />
+          <root url="jar://$MODULE_DIR$/lib/core/oscore-2.2.4.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </pairs>
       <pairs>
         <key>
-          <option name="value" value="153" />
+          <option name="value" value="155" />
         </key>
         <value predicate="moduleLibrary">
-          <url>jar://$MODULE_DIR$/lib/core/oscore-2.2.3.jar!/</url>
+          <url>jar://$MODULE_DIR$/lib/core/ognl-2.6.5.jar!/</url>
         </value>
       </pairs>
       <pairs>
         <key>
-          <option name="value" value="155" />
+          <option name="value" value="157" />
         </key>
         <value predicate="moduleLibrary">
-          <url>jar://$MODULE_DIR$/lib/core/ognl-2.6.5.jar!/</url>
+          <url>jar://$MODULE_DIR$/lib/core/oscore-2.2.4.jar!/</url>
         </value>
       </pairs>
     </orderEntriesWatcher>
       </info>
       <info>
         <key>
-          <option name="value" value="153" />
+          <option name="value" value="155" />
         </key>
         <value>
           <setting name="copy" value="false" />
       </info>
       <info>
         <key>
-          <option name="value" value="155" />
+          <option name="value" value="157" />
         </key>
         <value>
           <setting name="copy" value="false" />

File lib/core/ognl-2.6.5.jar

Binary file modified.

File lib/core/oscore-2.2.3.jar

Binary file removed.

File lib/core/oscore-2.2.4.jar

Binary file added.

File src/etc/taglib.tld

             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>class</name>
+            <name>cssClass</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>style</name>
+            <name>cssStyle</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         </attribute>
         <attribute>
             <name>label</name>
-            <required>true</required>
+            <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
             <rtexprvalue>false</rtexprvalue>
         </attribute>
         <attribute>
-            <name>class</name>
+            <name>cssClass</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>style</name>
+            <name>cssStyle</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         </attribute>
         <attribute>
             <name>label</name>
-            <required>true</required>
+            <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
             <rtexprvalue>false</rtexprvalue>
         </attribute>
         <attribute>
-            <name>class</name>
+            <name>cssClass</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>style</name>
+            <name>cssStyle</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
             <rtexprvalue>false</rtexprvalue>
         </attribute>
         <attribute>
-            <name>class</name>
+            <name>cssClass</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>style</name>
+            <name>cssStyle</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         </attribute>
         <attribute>
             <name>label</name>
-            <required>true</required>
+            <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
             <rtexprvalue>false</rtexprvalue>
         </attribute>
         <attribute>
-            <name>class</name>
+            <name>cssClass</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>style</name>
+            <name>cssStyle</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         </attribute>
         <attribute>
             <name>label</name>
-            <required>true</required>
+            <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
             <rtexprvalue>false</rtexprvalue>
         </attribute>
         <attribute>
-            <name>class</name>
+            <name>cssClass</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>style</name>
+            <name>cssStyle</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
             <rtexprvalue>false</rtexprvalue>
         </attribute>
         <attribute>
-            <name>class</name>
+            <name>cssClass</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>style</name>
+            <name>cssStyle</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
             <rtexprvalue>false</rtexprvalue>
         </attribute>
         <attribute>
-            <name>class</name>
+            <name>cssClass</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>style</name>
+            <name>cssStyle</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         </attribute>
         <attribute>
             <name>label</name>
-            <required>true</required>
+            <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
             <rtexprvalue>false</rtexprvalue>
         </attribute>
         <attribute>
-            <name>class</name>
+            <name>cssClass</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>style</name>
+            <name>cssStyle</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         </attribute>
         <attribute>
             <name>label</name>
-            <required>true</required>
+            <required>false</required>
             <rtexprvalue>false</rtexprvalue>
         </attribute>
         <attribute>
             <rtexprvalue>false</rtexprvalue>
         </attribute>
         <attribute>
-            <name>class</name>
+            <name>cssClass</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>style</name>
+            <name>cssStyle</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         </attribute>
         <attribute>
             <name>label</name>
-            <required>true</required>
+            <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
 <!--        </attribute>-->
 <!--        <attribute>-->
 <!--            <name>label</name>-->
-<!--            <required>true</required>-->
+<!--            <required>false</required>-->
 <!--            <rtexprvalue>true</rtexprvalue>-->
 <!--        </attribute>-->
 <!--        <attribute>-->
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>class</name>
+            <name>cssClass</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>style</name>
+            <name>cssStyle</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         </attribute>
         <attribute>
             <name>label</name>
-            <required>true</required>
+            <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>class</name>
+            <name>cssClass</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>style</name>
+            <name>cssStyle</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         </attribute>
         <attribute>
             <name>label</name>
-            <required>true</required>
+            <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>class</name>
+            <name>cssClass</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>
-            <name>style</name>
+            <name>cssStyle</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         </attribute>
         <attribute>
             <name>label</name>
-            <required>true</required>
+            <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
         <attribute>

File src/java/com/opensymphony/webwork/default.properties

 
 ### Standard UI theme
 # Change this to reflect which path should be used for JSP control tag templates by default
-webwork.ui.theme=/template/xhtml/
+webwork.ui.theme=xhtml
 
 ### Configuration reloading
 # This will cause the configuration to reload xwork.xml when it is changed

File src/java/com/opensymphony/webwork/views/jsp/ActionTag.java

         if (namespaceAttr == null) {
             namespace = buildNamespace();
         } else {
-            namespace = namespaceAttr;
+            namespace = findString(namespaceAttr);
         }
 
         // execute at this point, after params have been set

File src/java/com/opensymphony/webwork/views/jsp/ui/AbstractUITag.java

                 THEME += "/";
             }
         } catch (IllegalArgumentException e) {
-            LOG.warn("Unable to find 'webwork.ui.theme' property setting. Defaulting to /template/xhtml/", e);
-            THEME = "/template/xhtml/";
+            LOG.warn("Unable to find 'webwork.ui.theme' property setting. Defaulting to xhtml", e);
+            THEME = "xhtml";
         }
     }
 
     protected String tabindexAttr;
     protected String templateAttr;
     protected String themeAttr;
+    protected String theme;
+    protected String templateDir;
     protected String valueAttr;
-    protected String classAttr;
-    protected String styleAttr;
+    protected String cssClassAttr;
+    protected String cssStyleAttr;
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
         valueAttr = aValue;
     }
 
-    public void setClass(String aClass) {
-        classAttr = aClass;
+    public void setCssClass(String aCssClass) {
+        cssClassAttr = aCssClass;
     }
 
-    public void setStyle(String aStyle) {
-        this.styleAttr = aStyle;
+    public void setCssStyle(String aCssStyle) {
+        this.cssStyleAttr = aCssStyle;
     }
 
     public int doEndTag() throws JspException {
         return String.class;
     }
 
+    public String getTheme() {
+       // If theme set is not explicitly given,
+       // try to find attribute which states the theme set to use
+       if ((theme == null) || (theme == "")) {
+          theme = (String) pageContext.findAttribute("theme");
+       }
+
+       // Default template set
+       if ((theme == null) || (theme == "")) {
+          theme = Configuration.getString("webwork.ui.theme");
+       }
+
+       return theme;
+    }
+
+    public String getTemplateDir() {
+       // If templateDir is not explicitly given,
+       // try to find attribute which states the dir set to use
+       if ((templateDir == null) || (templateDir == "")) {
+         templateDir = (String) pageContext.findAttribute("templateDir");
+       }
+
+       // Default template set
+       if ((templateDir == null) || (templateDir == "")) {
+          templateDir = Configuration.getString("webwork.ui.templateDir");
+       }
+
+       if ((templateDir == null) || (templateDir == "")) {
+          templateDir = "template";
+       }
+
+       return templateDir;
+    }
+
     /**
      * @param myTemplate
      * @param myDefaultTemplate
      */
     protected String buildTemplateName(String myTemplate, String myDefaultTemplate) {
-        /**
-         * If no used defined template has been speccified, apply the appropriate theme to the default template
-         */
-        if (myTemplate == null) {
-            if (this.themeAttr == null) {
-                return THEME + myDefaultTemplate;
-            } else if (this.themeAttr.endsWith("/")) {
-                return this.themeAttr + myDefaultTemplate;
-            } else {
-                return this.themeAttr + "/" + myDefaultTemplate;
-            }
-
-            /**
-             * If a theme has been specified and it begins with a '/', allow this to override any theme value provided.
-             */
-        } else if (myTemplate.startsWith("/")) {
-            return myTemplate;
+        if (themeAttr != null)
+        {
+            theme = findString(themeAttr);
+        }
 
-            /**
-             * Otherwise, apply the appropriate theme to the user specified template
-             */
+        String template = null;
+        if (myTemplate == null) {
+            template = myDefaultTemplate;
         } else {
-            if (this.themeAttr == null) {
-                return THEME + myTemplate;
-            } else if (this.themeAttr.endsWith("/")) {
-                return this.themeAttr + myTemplate;
-            } else {
-                return this.themeAttr + "/" + myTemplate;
-            }
+            template = findString(myTemplate);
         }
+        return "/" + getTemplateDir() + "/" + getTheme() + "/" + template;
     }
 
     protected void evaluateExtraParams(OgnlValueStack stack) {
             addParameter("onchange", findValue(onchangeAttr, String.class));
         }
 
-        if (classAttr != null) {
-            addParameter("class", findValue(classAttr, String.class));
+        if (cssClassAttr != null) {
+            addParameter("cssClass", findValue(cssClassAttr, String.class));
         }
 
-        if (classAttr != null) {
-            addParameter("style", findValue(styleAttr, String.class));
+        if (cssStyleAttr != null) {
+            addParameter("cssStyle", findValue(cssStyleAttr, String.class));
         }
 
         FormTag tag = (FormTag) findAncestorWithClass(this, FormTag.class);
             addParameter("form", tag.getParameters());
         }
 
-        Class valueClazz = getValueClassType();
+        if (evaluateNameValue()) {
+            Class valueClazz = getValueClassType();
 
-        if (valueClazz != null) {
-            if (valueAttr != null) {
-                addParameter("nameValue", findValue(valueAttr, valueClazz));
-            } else if (name != null) {
-                addParameter("nameValue", findValue(name.toString(), valueClazz));
-            }
-        } else {
-            if (valueAttr != null) {
-                addParameter("nameValue", findValue(valueAttr));
-            } else if (name != null) {
-                addParameter("nameValue", findValue(name.toString()));
+            if (valueClazz != null) {
+                if (valueAttr != null) {
+                    addParameter("nameValue", findValue(valueAttr, valueClazz));
+                } else if (name != null) {
+                    addParameter("nameValue", findValue(name.toString(), valueClazz));
+                }
+            } else {
+                if (valueAttr != null) {
+                    addParameter("nameValue", findValue(valueAttr));
+                } else if (name != null) {
+                    addParameter("nameValue", findValue(name.toString()));
+                }
             }
         }
 
         evaluateExtraParams(stack);
     }
 
+    protected boolean evaluateNameValue() {
+        return true;
+    }
+
     protected void mergeTemplate(String templateName) throws Exception {
         Template t = velocityEngine.getTemplate(templateName);
         Context context = velocityManager.createContext(getStack(), pageContext.getRequest(), pageContext.getResponse());

File src/java/com/opensymphony/webwork/views/jsp/ui/FormTag.java

         }
     }
 
+    protected boolean evaluateNameValue() {
+        return false;
+    }
+
     protected String getDefaultTemplate() {
         return TEMPLATE;
     }

File src/java/template/simple/checkbox.vm

+#*
+  -- checkbox.vm
+  --
+  -- Required Parameters:
+  --   * label       - The description that will be used to identfy the control
+  --   * name        - The name of the attribute to put and pull the result from
+  --                   Equates to the NAME parameter of the HTML INPUT tag
+  --   * fieldValue  - The value displayed by the control.  Equates to the value
+  --                   of the HTML INPUT tag
+  --
+  -- Optional Parameters:
+  --   * disabled        - DISABLED parameter of the HTML INPUT tag
+  --   * tabindex        - tabindex parameter of the HTML INPUT tag
+  --   * onchange        - onkeyup parameter of the HTML INPUT tag
+    *#
+
+#* Use an extra table so that the checkbox doesn't align with the other columns. *#
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+    <tr><td valign="top">
+        <input type="checkbox"
+               name="$!webwork.htmlEncode($parameters.name)"
+               value="$!webwork.htmlEncode($parameters.fieldValue)"
+        #if ($parameters.nameValue)        checked="checked"                                        #end
+        #if ($parameters.disabled == true) disabled="disabled"                                      #end
+        #if ($parameters.tabindex)         tabindex="$!webwork.htmlEncode($parameters.tabindex)"    #end
+        #if ($parameters.onchange)         onchange="$!webwork.htmlEncode($parameters.onchange)"    #end
+        #if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
+        #if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"       #end
+        #if ($parameters.cssStyle)         style="$!webwork.htmlEncode($parameters.cssStyle)"       #end
+        />
+    </td>
+    <td width="100%" valign="top">
+        #if ($hasFieldErrors)
+            <span class="checkboxErrorLabel">
+        #else
+            <span class="checkboxLabel">
+        #end
+                $!webwork.htmlEncode($parameters.label)
+            </span>
+    </td>
+    </tr>
+</table>

File src/java/template/simple/checkboxlist.vm

+#set( $items = $parameters.list )
+#if( $items )
+#foreach( $item in $items )
+       $stack.push($item)
+
+        #if( $parameters.listKey )
+            #set( $itemKey = $stack.findValue($parameters.listKey) )
+        #else
+            #set( $itemKey = $item )
+        #end
+
+        #if( $parameters.listValue )
+            #set( $itemValue  = $stack.findValue($parameters.listValue) )
+        #else
+            #set( $itemValue = $item )
+        #end
+
+  <div>
+   <input type="checkbox" name="$!webwork.htmlEncode($parameters.name)" value="$!webwork.htmlEncode($itemKey)" #if( $tag.contains($parameters.nameValue, $itemKey) ) checked #end/>
+   <label class="label">$!webwork.htmlEncode($itemValue)</label>
+  </div>
+
+        #set ($trash = $stack.pop())
+#end
+
+#else
+  &nbsp;
+#end

File src/java/template/simple/combobox.vm

+#*
+  -- combobox.vm
+  --
+  -- Required Parameters:
+  --   * label  - The description that will be used to identfy the control.
+  --   * name   - The name of the attribute to put and pull the result from.
+  --              Equates to the NAME parameter of the HTML SELECT tag.
+  --   * list   - Iterator that will provide the options for the control.
+  --              Equates to the HTML OPTION tags in the SELECT and supplies
+  --              both the NAME and VALUE parameters of the OPTION tag.
+  --
+  -- Optional Parameters:
+  --   * labelposition   - determines were the label will be place in relation
+  --                       to the control.  Default is to the left of the control.
+  --   * size       - SIZE parameter of the HTML INPUT tag.
+  --   * maxlength  - MAXLENGTH parameter of the HTML INPUT tag.
+  --   * disabled   - DISABLED parameter of the HTML INPUT tag.
+  --   * onkeyup    - onkeyup parameter of the HTML INPUT tag.
+  --   * tabindex  - tabindex parameter of the HTML INPUT tag.
+  --   * onchange  - onkeyup parameter of the HTML INPUT tag.
+  --
+    *#
+<input type="text"
+       name="$!webwork.htmlEncode($parameters.name)"
+#if ($parameters.size)             size="$!webwork.htmlEncode($parameters.size)"            #end
+#if ($parameters.maxlength)        maxlength="$!webwork.htmlEncode($parameters.maxlength)"  #end
+#if ($parameters.nameValue)        value="$!webwork.htmlEncode($parameters.nameValue)"      #end
+#if ($parameters.disabled == true) disabled="disabled"                                      #end
+#if ($parameters.onkeyup)          onkeyup="$!webwork.htmlEncode($parameters.onkeyup)"      #end
+#if ($parameters.tabindex)         tabindex="$!webwork.htmlEncode($parameters.tabindex)"    #end
+#if ($parameters.onchange)         onchange="$!webwork.htmlEncode($parameters.onchange)"    #end
+#if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
+#if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"       #end
+#if ($parameters.cssStyle)         style="$!webwork.htmlEncode($parameters.cssStyle)"       #end
+/><br/>
+
+#if ($parameters.list)
+      <select onChange="this.form.elements['$!webwork.htmlEncode($parameters.name)'].value=this.options[this.selectedIndex].value"
+         #if ($parameters.disabled == true) disabled="disabled" #end
+      >
+            #foreach ($param in $parameters.list)
+                <option value="$!webwork.htmlEncode($param)" #if ($parameters.name == $param) selected="selected" #end >$!webwork.htmlEncode($param)</option>
+            #end
+      </select>
+#end
+

File src/java/template/simple/doubleselect.vm

+#set( $items = ${stack.findValue($tag.list)} )
+#if( $items )
+<select name="$!{tag.Name}" #if( $tag.Size > 0 )size="${tag.Size}" #end onChange="$!{tag.Name}Redirect(this.options.selectedIndex)">
+#foreach( $item in $items )
+  #if( $tag.ListKey )
+      #set( $itemKey = $ognl.findValue($tag.ListKey, $item) )
+  #else
+      #set( $itemKey = $item.toString() )
+  #end
+  #if( $tag.ListValue )
+      #set( $itemValue = $ognl.findValue($tag.ListValue, $item) )
+  #else
+      #set( $itemValue = $item.toString() )
+  #end
+  <option value="$!webwork.htmlEncode($itemValue)"#if( $tag.contains($tag.ActualValue, $itemValue) ) selected#end>$!{itemKey}</option>
+#end
+</select>
+
+<select name="$!{tag.DoubleName}" #if( $tag.Size > 0 )size="${tag.Size}" #end #if( $tag.Multiple ) multiple#end>
+</select>
+
+<script>
+<!--
+var $!{tag.Name}Group = new Array($items.size())
+for (i = 0; i < $items.size(); i++)
+$!{tag.Name}Group[i] = new Array()
+
+#set( $itemCount = 0 )
+#foreach( $item in $items )
+  #if( $tag.ListKey )
+      #set( $itemKey = $ognl.findValue($tag.ListKey, $item) )
+  #else
+      #set( $itemKey = $item.toString() )
+  #end
+  #if( $tag.ListValue )
+      #set( $itemValue = $ognl.findValue($tag.ListValue, $item) )
+  #else
+      #set( $itemValue = $item.toString() )
+  #end
+
+## CHANGE YOUR DOUBLE ITEMS HERE, WILL BE FIXED BY USING OGNL, NEED TO FIX THIS
+  #set( $doubleItems = $item.getChildren())
+  #set( $doubleItemCount = 0 )
+
+  #if( $doubleItems )
+    #foreach( $doubleItem in $doubleItems )
+      #if( $tag.DoubleListKey )
+          #set( $doubleItemKey = $ognl.findValue($tag.DoubleListKey, $doubleItem) )
+      #else
+          #set( $doubleItemKey = $doubleItem.toString() )
+      #end
+      #if( $tag.DoubleListValue )
+          #set( $doubleItemValue = $ognl.findValue($tag.DoubleListValue, $doubleItem) )
+      #else
+          #set( $doubleItemValue = $doubleItem.toString() )
+      #end
+
+$!{tag.Name}Group[$itemCount][$doubleItemCount] = new Option("$doubleItemKey", "$doubleItemValue")
+
+      #set( $doubleItemCount = $doubleItemCount + 1 )
+    #end
+    #set( $itemCount = $itemCount + 1 )
+  #end
+#end
+
+## CHANGE THE NAME OF YOUR FORM HERE, NEED TO FIX THIS
+var $!{tag.Name}Temp = document.inputform.$!{tag.DoubleName}
+
+#set( $itemCount = 0 )
+#set( $redirectTo = 0 )
+#foreach( $item in $items )
+  #if( $tag.ListValue )
+      #set( $itemValue = $ognl.findValue($tag.ListValue, $item) )
+  #else
+      #set( $itemValue = $item.toString() )
+  #end
+
+  #if( $tag.contains($tag.ActualValue, $itemValue) )
+    #set( $redirectTo = $itemCount )
+  #end
+  #set( $itemCount = $itemCount + 1 )
+#end
+
+$!{tag.Name}Redirect($redirectTo)
+
+function $!{tag.Name}Redirect(x) {
+  for (m = $!{tag.Name}Temp.options.length - 1; m >= 0; m--)
+    $!{tag.Name}Temp.options[m] = null
+
+  for (i = 0; i < $!{tag.Name}Group[x].length; i++) {
+    $!{tag.Name}Temp.options[i] = new Option($!{tag.Name}Group[x][i].text, $!{tag.Name}Group[x][i].value)
+  }
+
+  if ($!{tag.Name}Temp.options.length > 0)
+    $!{tag.Name}Temp.options[0].selected = true
+}
+//-->
+</script>
+
+#else
+  &nbsp;
+#end

File src/java/template/simple/empty.vm

Empty file added.

File src/java/template/simple/file.vm

+#*
+  -- file.vm
+  --
+  -- Required Parameters:
+  --   * label      - The description that will be used to identfy the control.
+  --   * name       - The name of the attribute to put and pull the result from.
+  --                  Equates to the NAME parameter of the HTML INPUT tag.
+  --
+  -- Optional Parameters:
+  --   * labelposition   - determines were the label will be place in relation
+  --                       to the control.  Default is to the left of the control.
+  --   * size       - SIZE parameter of the HTML INPUT tag.
+  --   * accept     - What files should be accepted
+  --   * disabled   - DISABLED parameter of the HTML INPUT tag.
+  --
+    *#
+<input type="file"
+                                   name="$!webwork.htmlEncode($parameters.name)"
+#if ($parameters.size)             size="$!webwork.htmlEncode($parameters.size)"            #end
+#if ($parameters.nameValue)        value="$!webwork.htmlEncode($parameters.nameValue)"      #end
+#if ($parameters.disabled == true) disabled="disabled"                                      #end
+#if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
+#if ($parameters.accept)           accept="$!webwork.htmlEncode($parameters.accept)"        #end
+#if ($parameters.onchange)         onchange="$!parameters.onchange"                         #end
+#if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"       #end
+#if ($parameters.cssStyle)         style="$!webwork.htmlEncode($parameters.cssStyle)"       #end
+/>

File src/java/template/simple/form-close.vm

+#if ($parameters.validate)
+    <script>
+    function ${parameters.name}_validate() {
+        var form = document.forms['${parameters.name}'];
+        var focus = ${parameters.name}_validate_actual();
+        if (focus != null) {
+            form.elements[focus].focus();
+            if (form.elements[focus].type == 'text' || form.elements[focus].type == 'textarea') {
+                form.elements[focus].select();            
+            }
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    function ${parameters.name}_validate_actual() {
+        var form = document.forms['${parameters.name}'];
+        $parameters.javascriptValidation
+        return null;
+    }
+    </script>
+#end
+</form>

File src/java/template/simple/form.vm

+<form
+    #if ($parameters.id)        id="$!webwork.htmlEncode($parameters.id)"           #end
+    #if ($parameters.name)      name="$!webwork.htmlEncode($parameters.name)"       #end
+    #if ($parameters.action)    action="$!webwork.htmlEncode($parameters.action)"   #end
+    #if ($parameters.method)    method="$!webwork.htmlEncode($parameters.method)"   #end
+    #if ($parameters.enctype)   enctype="$!webwork.htmlEncode($parameters.enctype)" #end
+    #if ($parameters.validate)  onsubmit="return(${parameters.name}_validate())"    #end
+>

File src/java/template/simple/hidden.vm

+<input
+    type="hidden"
+    #if ($parameters.name)      name="$!webwork.htmlEncode($parameters.name)"       #end
+    #if ($parameters.nameValue) value="$!webwork.htmlEncode($parameters.nameValue)" #end
+    #if ($parameters.cssClass)  class="$!webwork.htmlEncode($parameters.cssClass)"  #end
+    #if ($parameters.cssStyle)  style="$!webwork.htmlEncode($parameters.cssStyle)"  #end
+    #if ($parameters.id)        id="$!webwork.htmlEncode($parameters.id)"           #end
+/>

File src/java/template/simple/label.vm

+#*
+  -- label.vm
+  --
+  -- Required Parameters:
+  --   * label      - The description that will be used to identfy this text label
+  --
+  -- Optional Parameters:
+  --   * labelposition   - determines were the label will be place in relation
+  --                       to the control.  Default is to the left of the control.
+  *#
+<label
+#if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
+#if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"       #end
+#if ($parameters.cssStyle)         style="$!webwork.htmlEncode($parameters.cssStyle)"       #end
+> $!webwork.htmlEncode($parameters.nameValue) </label>

File src/java/template/simple/password.vm

+#*
+  -- password.vm
+  --
+  -- Required Parameters:
+  --   * label  - The description that will be used to identfy the control.
+  --   * name   - The name of the attribute to put and pull the result from.
+  --              Equates to the NAME parameter of the HTML INPUT tag.
+  --
+  -- Optional Parameters:
+  --   * labelposition   - determines were the label will be place in relation
+  --                       to the control.  Default is to the left of the control.
+  --   * size            - SIZE parameter of the HTML INPUT tag.
+  --   * maxlength       - MAXLENGTH parameter of the HTML INPUT tag.
+  --   * disabled        - DISABLED parameter of the HTML INPUT tag.
+  --   * readonly        - READONLY parameter of the HTML INPUT tag.
+  --   * onkeyup         - onkeyup parameter of the HTML INPUT tag.
+  --   * tabindex        - tabindex parameter of the HTML INPUT tag.
+  --   * onchange        - onkeyup parameter of the HTML INPUT tag.
+  --   * show            - determines whether the password is shown or not. Default is false.
+  --
+    *#
+
+<input type="password"
+                                   name="$!webwork.htmlEncode($parameters.name)"
+#if ($parameters.size)             size="$!webwork.htmlEncode($parameters.size)"            #end
+#if ($parameters.maxlength)        maxlength="$!webwork.htmlEncode($parameters.maxlength)"  #end
+
+#if ($parameters.nameValue && $parameters.showPassword == true)
+                                   value="$!webwork.htmlEncode($parameters.nameValue)"      #end
+
+#if ($parameters.disabled == true) disabled="disabled"                                      #end
+#if ($parameters.readonly)         readonly="readonly"                                      #end
+#if ($parameters.onkeyup)          onkeyup="$!webwork.htmlEncode($parameters.onkeyup)"      #end
+#if ($parameters.tabindex)         tabindex="$!webwork.htmlEncode($parameters.tabindex)"    #end
+#if ($parameters.onchange)         onchange="$!webwork.htmlEncode($parameters.onchange)"    #end
+#if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
+#if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"       #end
+/>

File src/java/template/simple/radiomap.vm

+#*
+  -- WebWork, Web Application Framework
+  --
+  -- Distributable under LGPL license.
+  -- See terms of license at opensource.org
+  --
+  --
+  -- radiomap.jsp
+  --
+  -- Required Parameters:
+  --   * label     - The description that will be used to identfy the control.
+  --   * name      - The name of the attribute to put and pull the result from.
+  --                 Equates to the NAME parameter of the HTML tag INPUT.
+  --   * list      - Iterator that will provide the options for the control.
+  --                 Equates to the HTML LABEL tags.
+  --   * listKey   - Where to get the values for the INPUT tag.  Equates to
+  --                 the VALUE parameter of the INPUT tag.
+  --   * listValue - The value displayed next to the radio control.  Equates to the body
+  --                 of the enclosing HTML LABEL tag.
+  --
+  -- Optional Parameters:
+  --   * labelposition   - determines were the label will be place in relation
+  --                       to the control.  Default is to the left of the control.
+  --   * disabled        - DISABLED parameter of the HTML INPUT tag.
+  --   * tabindex        - tabindex parameter of the HTML INPUT tag.
+  --   * onchange        - onkeyup parameter of the HTML INPUT tag.
+  --
+    *#
+#set( $items = $parameters.list )
+#if( $items )
+    #foreach( $item in $items )
+        $stack.push($item)
+
+        #if( $parameters.listKey )
+            #set( $itemKey = $stack.findValue($parameters.listKey) )
+        #else
+            #set( $itemKey = $item )
+        #end
+
+        #if( $parameters.listValue )
+            #set( $itemValue  = $stack.findValue($parameters.listValue) )
+        #else
+            #set( $itemValue = $item )
+        #end
+
+        <input
+            type="radio"
+            #if( $tag.contains($parameters.nameValue, $itemKey) )checked="checked"#end
+            #if ($parameters.name)
+                                        name="$!webwork.htmlEncode($parameters.name)"
+                                        id="$!webwork.htmlEncode($parameters.name)$!webwork.htmlEncode($itemKey)"
+            #end
+            #if ($itemKey)              value="$!webwork.htmlEncode($itemKey)"                #end
+            #if ($parameters.disabled)  disabled="disabled"                                   #end
+            #if ($parameters.tabindex)  tabindex="$!webwork.htmlEncode($parameters.tabindex)" #end
+            #if ($parameters.onchange)  onchange="$!webwork.htmlEncode($parameters.onchange)" #end
+            #if ($parameters.cssClass)  class="$!webwork.htmlEncode($parameters.cssClass)"    #end
+            #if ($parameters.cssStyle)  style="$!webwork.htmlEncode($parameters.cssStyle)"    #end
+        />
+        <label for="$!webwork.htmlEncode($parameters.name)$!webwork.htmlEncode($itemKey)">$!itemValue</label>
+
+        #set ($trash = $stack.pop())
+    #end
+#end

File src/java/template/simple/select.vm

+#*
+  -- selectmap.vm
+  --
+  -- Required Parameters:
+  --   * label  - The description that will be used to identfy the control.
+  --   * name   - The name of the attribute to put and pull the result from.
+  --              Equates to the NAME parameter of the HTML SELECT tag.
+  --   * list   - Iterator that will provide the options for the control.
+  --              Equates to the HTML OPTION tags in the SELECT and supplies
+  --              both the NAME and VALUE parameters of the OPTION tag.
+  --
+  -- Optional Parameters:
+  --   * labelposition   - determines were the label will be place in relation
+  --                       to the control.  Default is to the left of the control.
+  --   * size            - SIZE parameter of the HTML SELECT tag.
+  --   * disabled        - DISABLED parameter of the HTML SELECT tag.
+  --   * tabindex        - tabindex parameter of the HTML SELECT tag.
+  --   * onchange        - onkeyup parameter of the HTML SELECT tag.
+  --   * size            - SIZE parameter of the HTML SELECT tag.
+  --   * multiple        - MULTIPLE parameter of the HTML SELECT tag.
+  --   * headerKey       - Combined with headerValue parameter specifies the top of select list
+  --   * headerValue     - see above
+  --
+    *#
+<select name="$!parameters.name"
+    #if ($parameters.size)             size="$parameters.size"                              #end
+    #if ($parameters.disabled)         disabled="disabled"                                  #end
+    #if ($parameters.tabindex)         tabindex="$parameters.tabindex"                      #end
+    #if ($parameters.onchange)         onchange="$parameters.onchange"                      #end
+    #if ($parameters.id)               id="$parameters.id"                                  #end
+    #if ($parameters.multiple)         multiple="multiple"                                  #end
+    #if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"   #end
+    #if ($parameters.cssStyle)         style="$!webwork.htmlEncode($parameters.cssStyle)"   #end
+>
+
+#if ($parameters.headerKey && $parameters.headerValue)
+    <option value="$!webwork.htmlEncode($parameters.headerKey)">$!webwork.htmlEncode($parameters.headerValue)</option>
+#end
+
+#if ($parameters.emptyOption)
+    <option value=""></option>
+#end
+
+#set( $items = $parameters.list )
+#if( $items )
+    #foreach( $item in $items )
+        $stack.push($item)
+
+        #if( $parameters.listKey )
+            #set( $itemKey = $stack.findValue($parameters.listKey) )
+        #else
+            #set( $itemKey = $item )
+        #end
+
+        #if( $parameters.listValue )
+            #set( $itemValue  = $stack.findValue($parameters.listValue) )
+        #else
+            #set( $itemValue = $item )
+        #end
+
+        <option value="$!webwork.htmlEncode($itemKey)"
+            #if( $tag.contains($parameters.nameValue, $itemKey) )selected#end
+        >$!webwork.htmlEncode($itemValue)</option>
+
+        #set ($trash = $stack.pop())
+    #end
+#end
+
+</select>

File src/java/template/simple/submit.vm

+<div
+        #if ($parameters.align)      align="$!webwork.htmlEncode($parameters.align)"     #end
+        ><input
+            type="submit"
+            #if ($parameters.name)       name="$!webwork.htmlEncode($parameters.name)"           #end
+            #if ($parameters.nameValue)  value="$!webwork.htmlEncode($parameters.nameValue)"     #end
+            #if ($parameters.cssClass)   class="$!webwork.htmlEncode($parameters.cssClass)"      #end
+            #if ($parameters.cssStyle)   style="$!webwork.htmlEncode($parameters.cssStyle)"      #end
+        /></div>

File src/java/template/simple/tabbedpane.vm

+#*
+  -- WebWork, Web Application Framework
+  --
+  -- Distributable under LGPL license.
+  -- See terms of license at opensource.org
+  --
+  --
+  -- tabbedpane.jsp
+  --
+  -- Required Parameters:
+  --   * contentName      - The name of the data map to be used.
+  --
+  -- Optional Parameters:
+  --   * tabAlign 	-	 The Alignment of the tabs. Default is the CENTER of the control.
+  --   * id  				- 	 Id of the control.
+  --
+  *#
+
+#bean ("com.opensymphony.webwork.util.Counter" $tabIndex)
+#set ($tabIndex.first = 0)
+#set ($tabIndex.last = $tag.content.size())
+
+<table border="1" cellspacing="0" cellpadding="5" id="$!webwork.htmlEncode($tag.id)">
+
+	<tr valign="bottom" align="$!webwork.htmlEncode($tag.tabAlign)">
+
+	#if ($tabAlign == 'CENTER' || $tabAlign == 'RIGHT')
+        <th colspan ="1" width="*"></th>
+    #end
+
+    #foreach ($c in $tag.content)
+        $stack.push($c)
+
+        <th width="10%"
+            #if ($tag.compareNumbers($tag.selectedIndex, $tabIndex.current))
+                #set ($isCur = 'true')
+                bgcolor="#A0B3FC"
+            #else
+                #set ($isCur = 'false')
+                bgcolor="#C0C0C0"
+            #end
+        >
+
+        #url ($url)
+        <a href="$url.addParameter($tag.indexLink, $tabIndex.next)">
+
+        #if ($isCur == 'true')
+            <em>
+        #end
+        $!webwork.htmlEncode($key)
+        #if ($isCur == 'true')
+            </em>
+        #end
+
+        </a>
+
+        </th>
+
+        #set ($trash = $stack.pop())
+    #end
+
+    #if ($tabAlign == 'CENTER' || $tabAlign == 'LEFT')
+        <th colspan ="1" width="*"></th>
+    #end
+
+    </tr>
+	<tr>
+		<td bgcolor="#E1EAE8" colspan="$tag.colSpanLength" width="100%">
+			#includeservlet ($tag.selectedUrl)
+		</td>
+	</tr>
+
+</table>

File src/java/template/simple/table.vm

+#set($webTable=$tag)
+#set($tableModel=$webTable.Model)
+
+
+#if($tableModel)
+		<p align="center">
+			<table bgcolor="white" border="0" cellpadding="1" cellspacing="0" >
+				<tr>
+					<td>
+						<table  border="0" cellpadding="2" cellspacing="1">
+
+                            <tr bgcolor="yellow">
+
+                            #*
+                                Show the visible column names.  Use the display name that can
+                                be set in the jsp.
+                            *#
+                            #foreach($curColumn in $webTable.Columns)
+                                #if($curColumn.isVisible())
+                                        <th>
+
+                                            #if($webTable.isSortable())
+                                                <table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+												    <td>
+												        $curColumn.DisplayName
+												    </td>
+												    <td>
+												        <table border="0" cellspacing="0" cellpadding="0">
+												            <tr>
+                                                                <td align="bottom">
+
+                                                                    #if(($curColumn.sortColumn == $curColumn.offset) && ($curColumn.sortOrder == 'ASC'))
+                                                                        <img src="images/sorted_asc.gif" border="0" align="bottom"/>
+                                                                    #else
+                                                                        <a href="#bodytag( URL )
+                                                                                    #param( "$webTable.sortColumnLinkName $curColumn.offset)
+                                                                                    #param( $webTable.sortOrderLinkName 'ASC')
+                                                                                 #end>
+                                                                       <img src="images/unsorted_asc.gif" border="0" align="bottom"/></a>
+                                                                    #end
+                                                                </td>
+												            </tr>
+												            <tr>
+
+                                                                <td align="top">
+                                                                    #if(($curColumn.sortColumn == $curColumn.offset) && ($curColumn.sortOrder == 'DESC'))
+                                                                        <img src="images/sorted_desc.gif" border="0" align="top"/>
+                                                                    #else
+                                                                        <a href="#bodytag( URL )
+                                                                                    #param( "$webTable.sortColumnLinkName $curColumn.offset)
+                                                                                    #param( $webTable.sortOrderLinkName 'DESC')
+                                                                                  #end><img src="images/sorted_desc.gif" border="0" align="top"/></a>
+                                                                    #end
+                                                                </td>
+                                                            </tr>
+												        </table>
+
+												    </td>
+												</tr>
+												</table>
+                                            #else
+                                                $curColumn.DisplayName
+                                            #end
+                                        </th>
+                                #end
+                            #end
+                            </tr>
+                             #foreach($curRow in $webTable.RowIterator)
+                                <tr #if($velocityCount % 2 == 1) bgcolor="EEEEFF" #else bgcolor="FFFFFF" #end/>
+                                #foreach($curColumn in $curRow)
+                                <td>$curColumn</td>
+
+                                #end
+                             #end
+						</table>
+					</td>
+				</tr>
+			</table>
+		</p>
+
+#end

File src/java/template/simple/text.vm

+#*
+  -- text.vm
+  --
+  -- Required Parameters:
+  --   * label      - The description that will be used to identfy the control.
+  --   * name       - The name of the attribute to put and pull the result from.
+  --                  Equates to the NAME parameter of the HTML INPUT tag.
+  --
+  -- Optional Parameters:
+  --   * labelposition   - determines were the label will be place in relation
+  --                       to the control.  Default is to the left of the control.
+  --   * size       - SIZE parameter of the HTML INPUT tag.
+  --   * maxlength  - MAXLENGTH parameter of the HTML INPUT tag.
+  --   * disabled   - DISABLED parameter of the HTML INPUT tag.
+  --   * readonly   - READONLY parameter of the HTML INPUT tag.
+  --   * onkeyup    - onkeyup parameter of the HTML INPUT tag.
+  --   * tabindex  - tabindex parameter of the HTML INPUT tag.
+  --   * onchange  - onkeyup parameter of the HTML INPUT tag.
+  --
+    *#
+<input type="text"
+                                   name="$!webwork.htmlEncode($parameters.name)"
+#if ($parameters.size)             size="$!webwork.htmlEncode($parameters.size)"            #end
+#if ($parameters.maxlength)        maxlength="$!webwork.htmlEncode($parameters.maxlength)"  #end
+#if ($parameters.nameValue)        value="$!webwork.htmlEncode($parameters.nameValue)"      #end
+#if ($parameters.disabled == true) disabled="disabled"                                      #end
+#if ($parameters.readonly)         readonly="readonly"                                      #end
+#if ($parameters.onkeyup)          onkeyup="$!webwork.htmlEncode($parameters.onkeyup)"      #end
+#if ($parameters.tabindex)         tabindex="$!webwork.htmlEncode($parameters.tabindex)"    #end
+#if ($parameters.onchange)         onchange="$!webwork.htmlEncode($parameters.onchange)"    #end
+#if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
+#if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"       #end
+#if ($parameters.cssStyle)         style="$!webwork.htmlEncode($parameters.cssStyle)"       #end
+/>

File src/java/template/simple/textarea.vm

+#*
+  -- textarea.vm
+  --
+  -- Required Parameters:
+  --   * label  - The description that will be used to identfy the control.
+  --   * name   - The name of the attribute to put and pull the result from.
+  --              Equates to the NAME parameter of the HTML INPUT tag.
+  --   * cols   - Width of the textarea.  Equates to the COLS parameter of
+  --              HTML tag TEXTAREA.
+  --   * rows   - Height of the textarea.  Equates to the ROWS parameter of
+  --              HTML tag TEXTAREA.
+  --
+  -- Optional Parameters:
+  --   * labelposition   - determines were the label will be place in relation
+  --                       to the control.  Default is to the left of the control.
+  --   * disabled  - DISABLED parameter of the HTML TEXTAREA tag.
+  --   * readonly  - READONLY parameter of the HTML TEXTAREA tag.
+  --   * onkeyup   - onkeyup parameter of the HTML TEXTAREA tag.
+  --   * tabindex  - tabindex parameter of the HTML TEXTAREA tag.
+  --   * onchange  - onkeyup parameter of the HTML TEXTAREA tag.
+  --
+    *#
+<textarea name="$!webwork.htmlEncode($parameters.name)"
+          cols="$!webwork.htmlEncode($parameters.cols)"
+          rows="$!webwork.htmlEncode($parameters.rows)"
+#if ($parameters.nameValue)        value="$!webwork.htmlEncode($parameters.nameValue)"      #end
+#if ($parameters.disabled == true) disabled="disabled"                                      #end
+#if ($parameters.readonly)         readonly="readonly"                                      #end
+#if ($parameters.onkeyup)          onkeyup="$!webwork.htmlEncode($parameters.onkeyup)"      #end
+#if ($parameters.tabindex)         tabindex="$!webwork.htmlEncode($parameters.tabindex)"    #end
+#if ($parameters.onchange)         onchange="$!webwork.htmlEncode($parameters.onchange)"    #end
+#if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
+#if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"       #end
+#if ($parameters.cssStyle)         style="$!webwork.htmlEncode($parameters.cssStyle)"       #end
+>$!webwork.htmlEncode($parameters.nameValue)</textarea>

File src/java/template/simple/token.vm

+<input type="hidden" name="$!{tag.tokenNameField}" value="$webwork.htmlEncode($!parameters.name)"/>
+<input type="hidden" name="$!parameters.name" value="$webwork.htmlEncode($!parameters.token)"/>

File src/java/template/xhtml/checkbox.vm

-#*
-  -- checkbox.vm
-  --
-  -- Required Parameters:
-  --   * label       - The description that will be used to identfy the control
-  --   * name        - The name of the attribute to put and pull the result from
-  --                   Equates to the NAME parameter of the HTML INPUT tag
-  --   * fieldValue  - The value displayed by the control.  Equates to the value
-  --                   of the HTML INPUT tag
-  --
-  -- Optional Parameters:
-  --   * disabled        - DISABLED parameter of the HTML INPUT tag
-  --   * tabindex        - tabindex parameter of the HTML INPUT tag
-  --   * onchange        - onkeyup parameter of the HTML INPUT tag
-    *#
-
 #if( $fieldErrors.get($parameters.name) )
   #set ($hasFieldErrors = $fieldErrors.get($parameters.name))
   #foreach ($error in $fieldErrors.get($parameters.name))
 
 <tr>
     <td  valign="top" colspan="2">
-        #* Use an extra table so that the checkbox doesn't align with the other columns. *#
-        <table width="100%" border="0" cellpadding="0" cellspacing="0">
-            <tr><td valign="top">
-                <input type="checkbox"
-                       name="$!webwork.htmlEncode($parameters.name)"
-                       value="$!webwork.htmlEncode($parameters.fieldValue)"
-                #if ($parameters.nameValue)        checked="checked" #end
-                #if ($parameters.disabled == true) disabled="disabled"                #end
-                #if ($parameters.tabindex)         tabindex="$!webwork.htmlEncode($parameters.tabindex)"    #end
-                #if ($parameters.onchange)         onchange="$!webwork.htmlEncode($parameters.onchange)"    #end
-                #if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
-                #if ($parameters.get('class'))     class="$!webwork.htmlEncode($parameters.get('class'))"   #end
-                #if ($parameters.style)            style="$!webwork.htmlEncode($parameters.style)"          #end
-                />
-            </td>
-            <td width="100%" valign="top">
-                #if ($hasFieldErrors)
-                    <span class="checkboxErrorLabel">
-                #else
-                    <span class="checkboxLabel">
-                #end
-                        $!webwork.htmlEncode($parameters.label)
-                    </span>
-            </td>
-            </tr>
-        </table>
+#parse("/template/simple/checkbox.vm")
+
 #parse("/template/xhtml/controlfooter.vm")

File src/java/template/xhtml/checkboxlist.vm

 #parse( "/template/xhtml/controlheader.vm" )
-#set( $items = $parameters.list )
-#if( $items )
-#foreach( $item in $items )
-       $stack.push($item)
-
-        #if( $parameters.listKey )
-            #set( $itemKey = $stack.findValue($parameters.listKey) )
-        #else
-            #set( $itemKey = $item )
-        #end
-
-        #if( $parameters.listValue )
-            #set( $itemValue  = $stack.findValue($parameters.listValue) )
-        #else
-            #set( $itemValue = $item )
-        #end
-
-  <div>
-   <input type="checkbox" name="$!webwork.htmlEncode($parameters.name)" value="$!webwork.htmlEncode($itemKey)" #if( $tag.contains($parameters.nameValue, $itemKey) ) checked #end/>
-   <label class="label">$!webwork.htmlEncode($itemValue)</label>
-  </div>
-
-        #set ($trash = $stack.pop())
-#end
-
-#else
-  &nbsp;
-#end
-
+#parse( "/template/simple/checkboxlist.vm" )
 #parse( "/template/xhtml/controlfooter.vm" )

File src/java/template/xhtml/combobox.vm

-#*
-  -- combobox.vm
-  --
-  -- Required Parameters:
-  --   * label  - The description that will be used to identfy the control.
-  --   * name   - The name of the attribute to put and pull the result from.
-  --              Equates to the NAME parameter of the HTML SELECT tag.
-  --   * list   - Iterator that will provide the options for the control.
-  --              Equates to the HTML OPTION tags in the SELECT and supplies
-  --              both the NAME and VALUE parameters of the OPTION tag.
-  --
-  -- Optional Parameters:
-  --   * labelposition   - determines were the label will be place in relation
-  --                       to the control.  Default is to the left of the control.
-  --   * size       - SIZE parameter of the HTML INPUT tag.
-  --   * maxlength  - MAXLENGTH parameter of the HTML INPUT tag.
-  --   * disabled   - DISABLED parameter of the HTML INPUT tag.
-  --   * onkeyup    - onkeyup parameter of the HTML INPUT tag.
-  --   * tabindex  - tabindex parameter of the HTML INPUT tag.
-  --   * onchange  - onkeyup parameter of the HTML INPUT tag.
-  --
-    *#
 #parse("/template/xhtml/controlheader.vm")
-
-<input type="text"
-       name="$!webwork.htmlEncode($parameters.name)"
-#if ($parameters.size)             size="$!webwork.htmlEncode($parameters.size)"            #end
-#if ($parameters.maxlength)        maxlength="$!webwork.htmlEncode($parameters.maxlength)"  #end
-#if ($parameters.nameValue)        value="$!webwork.htmlEncode($parameters.nameValue)"      #end
-#if ($parameters.disabled == true) disabled="disabled"                #end
-#if ($parameters.onkeyup)          onkeyup="$!webwork.htmlEncode($parameters.onkeyup)"      #end
-#if ($parameters.tabindex)         tabindex="$!webwork.htmlEncode($parameters.tabindex)"    #end
-#if ($parameters.onchange)         onchange="$!webwork.htmlEncode($parameters.onchange)"    #end
-#if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
-#if ($parameters.get('class'))     class="$!webwork.htmlEncode($parameters.get('class'))"   #end
-#if ($parameters.style)            style="$!webwork.htmlEncode($parameters.style)"          #end
-/><br/>
-
-#if ($parameters.list)
-      <select onChange="this.form.elements['$!webwork.htmlEncode($parameters.name)'].value=this.options[this.selectedIndex].value"
-         #if ($parameters.disabled == true) disabled="disabled" #end
-      >
-            #foreach ($param in $parameters.list)
-                <option value="$!webwork.htmlEncode($param)" #if ($parameters.name == $param) selected="selected" #end >$!webwork.htmlEncode($param)</option>
-            #end
-      </select>
-#end
-
+#parse("/template/simple/combobox.vm")
 #parse("/template/xhtml/controlfooter.vm")

File src/java/template/xhtml/doubleselect.vm

 #parse( "/template/xhtml/controlheader.vm" )
-
-#set( $items = ${stack.findValue($tag.list)} )
-#if( $items )
-<select name="$!{tag.Name}" #if( $tag.Size > 0 )size="${tag.Size}" #end onChange="$!{tag.Name}Redirect(this.options.selectedIndex)">
-#foreach( $item in $items )
-  #if( $tag.ListKey )
-      #set( $itemKey = $ognl.findValue($tag.ListKey, $item) )
-  #else
-      #set( $itemKey = $item.toString() )
-  #end
-  #if( $tag.ListValue )
-      #set( $itemValue = $ognl.findValue($tag.ListValue, $item) )
-  #else
-      #set( $itemValue = $item.toString() )
-  #end
-  <option value="$!webwork.htmlEncode($itemValue)"#if( $tag.contains($tag.ActualValue, $itemValue) ) selected#end>$!{itemKey}</option>
-#end
-</select>
-
-<select name="$!{tag.DoubleName}" #if( $tag.Size > 0 )size="${tag.Size}" #end #if( $tag.Multiple ) multiple#end>
-</select>
-
-<script>
-<!--
-var $!{tag.Name}Group = new Array($items.size())
-for (i = 0; i < $items.size(); i++)
-$!{tag.Name}Group[i] = new Array()
-
-#set( $itemCount = 0 )
-#foreach( $item in $items )
-  #if( $tag.ListKey )
-      #set( $itemKey = $ognl.findValue($tag.ListKey, $item) )
-  #else
-      #set( $itemKey = $item.toString() )
-  #end
-  #if( $tag.ListValue )
-      #set( $itemValue = $ognl.findValue($tag.ListValue, $item) )
-  #else
-      #set( $itemValue = $item.toString() )
-  #end
-
-## CHANGE YOUR DOUBLE ITEMS HERE, WILL BE FIXED BY USING OGNL, NEED TO FIX THIS
-  #set( $doubleItems = $item.getChildren())
-  #set( $doubleItemCount = 0 )
-
-  #if( $doubleItems )
-    #foreach( $doubleItem in $doubleItems )
-      #if( $tag.DoubleListKey )
-          #set( $doubleItemKey = $ognl.findValue($tag.DoubleListKey, $doubleItem) )
-      #else
-          #set( $doubleItemKey = $doubleItem.toString() )
-      #end
-      #if( $tag.DoubleListValue )
-          #set( $doubleItemValue = $ognl.findValue($tag.DoubleListValue, $doubleItem) )
-      #else
-          #set( $doubleItemValue = $doubleItem.toString() )
-      #end
-
-$!{tag.Name}Group[$itemCount][$doubleItemCount] = new Option("$doubleItemKey", "$doubleItemValue")
-
-      #set( $doubleItemCount = $doubleItemCount + 1 )
-    #end
-    #set( $itemCount = $itemCount + 1 )
-  #end
-#end
-
-## CHANGE THE NAME OF YOUR FORM HERE, NEED TO FIX THIS
-var $!{tag.Name}Temp = document.inputform.$!{tag.DoubleName}
-
-#set( $itemCount = 0 )
-#set( $redirectTo = 0 )
-#foreach( $item in $items )
-  #if( $tag.ListValue )
-      #set( $itemValue = $ognl.findValue($tag.ListValue, $item) )
-  #else
-      #set( $itemValue = $item.toString() )
-  #end
-
-  #if( $tag.contains($tag.ActualValue, $itemValue) )
-    #set( $redirectTo = $itemCount )
-  #end
-  #set( $itemCount = $itemCount + 1 )
-#end
-
-$!{tag.Name}Redirect($redirectTo)
-
-function $!{tag.Name}Redirect(x) {
-  for (m = $!{tag.Name}Temp.options.length - 1; m >= 0; m--)
-    $!{tag.Name}Temp.options[m] = null
-
-  for (i = 0; i < $!{tag.Name}Group[x].length; i++) {
-    $!{tag.Name}Temp.options[i] = new Option($!{tag.Name}Group[x][i].text, $!{tag.Name}Group[x][i].value)
-  }
-
-  if ($!{tag.Name}Temp.options.length > 0)
-    $!{tag.Name}Temp.options[0].selected = true
-}
-//-->
-</script>
-
-#else
-  &nbsp;
-#end
+#parse( "/template/simple/doubleselect.vm" )
 #parse( "/template/xhtml/controlfooter.vm" )

File src/java/template/xhtml/file.vm

-#*
-  -- file.vm
-  --
-  -- Required Parameters:
-  --   * label      - The description that will be used to identfy the control.
-  --   * name       - The name of the attribute to put and pull the result from.
-  --                  Equates to the NAME parameter of the HTML INPUT tag.
-  --
-  -- Optional Parameters:
-  --   * labelposition   - determines were the label will be place in relation
-  --                       to the control.  Default is to the left of the control.
-  --   * size       - SIZE parameter of the HTML INPUT tag.
-  --   * accept     - What files should be accepted
-  --   * disabled   - DISABLED parameter of the HTML INPUT tag.
-  --
-    *#
 #parse("/template/xhtml/controlheader.vm")
-
-<input type="file"
-                                   name="$!webwork.htmlEncode($parameters.name)"
-#if ($parameters.size)             size="$!webwork.htmlEncode($parameters.size)"            #end
-#if ($parameters.nameValue)        value="$!webwork.htmlEncode($parameters.nameValue)"      #end
-#if ($parameters.disabled == true) disabled="disabled"                                      #end
-#if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
-#if ($parameters.accept)           accept="$!webwork.htmlEncode($parameters.accept)"        #end
-#if ($parameters.onchange)         onchange="$!parameters.onchange"                         #end
-#if ($parameters.get('class'))     class="$!webwork.htmlEncode($parameters.get('class'))"   #end
-#if ($parameters.style)            style="$!webwork.htmlEncode($parameters.style)"          #end
-/>
-
+#parse("/template/simple/file.vm")
 #parse("/template/xhtml/controlfooter.vm")

File src/java/template/xhtml/form-close.vm

-#if ($parameters.validate)
-    <script>
-    function ${parameters.name}_validate() {
-        var form = document.forms['${parameters.name}'];
-        var focus = ${parameters.name}_validate_actual();
-        if (focus != null) {
-            form.elements[focus].focus();
-            if (form.elements[focus].type == 'text' || form.elements[focus].type == 'textarea') {
-                form.elements[focus].select();            
-            }
-            return false;
-        } else {
-            return true;
-        }
-    }
-
-    function ${parameters.name}_validate_actual() {
-        var form = document.forms['${parameters.name}'];
-        $parameters.javascriptValidation
-        return null;
-    }
-    </script>
-#end
-</form>
+#parse("/template/simple/form-close.vm")
 </table>

File src/java/template/xhtml/form.vm

 <table>
-<form
-    #if ($parameters.id)        id="$!webwork.htmlEncode($parameters.id)"           #end
-    #if ($parameters.name)      name="$!webwork.htmlEncode($parameters.name)"       #end
-    #if ($parameters.action)    action="$!webwork.htmlEncode($parameters.action)"   #end
-    #if ($parameters.method)    method="$!webwork.htmlEncode($parameters.method)"   #end
-    #if ($parameters.enctype)   enctype="$!webwork.htmlEncode($parameters.enctype)" #end
-    #if ($parameters.validate)  onsubmit="return(${parameters.name}_validate())"    #end
->
+#parse("/template/simple/form.vm")

File src/java/template/xhtml/hidden.vm

-<input
-    type="hidden"
-    #if ($parameters.name)      name="$!webwork.htmlEncode($parameters.name)"       #end
-    #if ($parameters.nameValue) value="$!webwork.htmlEncode($parameters.nameValue)" #end
-    #if ($parameters.get('class'))     class="$!webwork.htmlEncode($parameters.get('class'))"   #end
-    #if ($parameters.style)            style="$!webwork.htmlEncode($parameters.style)"          #end
-/>
+#parse("/template/simple/hidden.vm")

File src/java/template/xhtml/label.vm

-#*
-  -- label.vm
-  --
-  -- Required Parameters:
-  --   * label      - The description that will be used to identfy this text label
-  --
-  -- Optional Parameters:
-  --   * labelposition   - determines were the label will be place in relation
-  --                       to the control.  Default is to the left of the control.
-  *#
 #parse("/template/xhtml/controlheader.vm")
-<label
-#if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
-#if ($parameters.get('class'))     class="$!webwork.htmlEncode($parameters.get('class'))"   #end
-#if ($parameters.style)            style="$!webwork.htmlEncode($parameters.style)"          #end
-> $!webwork.htmlEncode($parameters.nameValue) </label>
+#parse("/template/simple/label.vm")
 #parse("/template/xhtml/controlfooter.vm")

File src/java/template/xhtml/password.vm

-#*
-  -- password.vm
-  --
-  -- Required Parameters:
-  --   * label  - The description that will be used to identfy the control.
-  --   * name   - The name of the attribute to put and pull the result from.
-  --              Equates to the NAME parameter of the HTML INPUT tag.
-  --
-  -- Optional Parameters:
-  --   * labelposition   - determines were the label will be place in relation
-  --                       to the control.  Default is to the left of the control.
-  --   * size            - SIZE parameter of the HTML INPUT tag.
-  --   * maxlength       - MAXLENGTH parameter of the HTML INPUT tag.
-  --   * disabled        - DISABLED parameter of the HTML INPUT tag.
-  --   * readonly        - READONLY parameter of the HTML INPUT tag.
-  --   * onkeyup         - onkeyup parameter of the HTML INPUT tag.
-  --   * tabindex        - tabindex parameter of the HTML INPUT tag.
-  --   * onchange        - onkeyup parameter of the HTML INPUT tag.
-  --   * show            - determines whether the password is shown or not. Default is false.
-  --
-    *#
-
 #parse("/template/xhtml/controlheader.vm")
-
-<input type="password"
-                                   name="$!webwork.htmlEncode($parameters.name)"
-#if ($parameters.size)             size="$!webwork.htmlEncode($parameters.size)"            #end
-#if ($parameters.maxlength)        maxlength="$!webwork.htmlEncode($parameters.maxlength)"  #end
-
-#if ($parameters.nameValue && $parameters.showPassword == true)        value="$!webwork.htmlEncode($parameters.nameValue)"      #end
-
-#if ($parameters.disabled == true) disabled="disabled"                #end
-#if ($parameters.readonly)         readonly="readonly"                #end
-#if ($parameters.onkeyup)          onkeyup="$!webwork.htmlEncode($parameters.onkeyup)"      #end
-#if ($parameters.tabindex)         tabindex="$!webwork.htmlEncode($parameters.tabindex)"    #end
-#if ($parameters.onchange)         onchange="$!webwork.htmlEncode($parameters.onchange)"    #end
-#if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
-/>
-
+#parse("/template/simple/password.vm")
 #parse("/template/xhtml/controlfooter.vm")

File src/java/template/xhtml/radiomap.vm

-#*
-  -- WebWork, Web Application Framework
-  --
-  -- Distributable under LGPL license.
-  -- See terms of license at opensource.org
-  --
-  --
-  -- radiomap.jsp
-  --
-  -- Required Parameters:
-  --   * label     - The description that will be used to identfy the control.
-  --   * name      - The name of the attribute to put and pull the result from.
-  --                 Equates to the NAME parameter of the HTML tag INPUT.
-  --   * list      - Iterator that will provide the options for the control.
-  --                 Equates to the HTML LABEL tags.
-  --   * listKey   - Where to get the values for the INPUT tag.  Equates to
-  --                 the VALUE parameter of the INPUT tag.
-  --   * listValue - The value displayed next to the radio control.  Equates to the body
-  --                 of the enclosing HTML LABEL tag.
-  --
-  -- Optional Parameters:
-  --   * labelposition   - determines were the label will be place in relation
-  --                       to the control.  Default is to the left of the control.
-  --   * disabled        - DISABLED parameter of the HTML INPUT tag.
-  --   * tabindex        - tabindex parameter of the HTML INPUT tag.
-  --   * onchange        - onkeyup parameter of the HTML INPUT tag.
-  --
-    *#
 #parse("/template/xhtml/controlheader.vm")
-
-#set( $items = $parameters.list )
-#if( $items )
-    #foreach( $item in $items )
-        $stack.push($item)
-
-        #if( $parameters.listKey )
-            #set( $itemKey = $stack.findValue($parameters.listKey) )
-        #else
-            #set( $itemKey = $item )
-        #end
-
-        #if( $parameters.listValue )
-            #set( $itemValue  = $stack.findValue($parameters.listValue) )
-        #else
-            #set( $itemValue = $item )
-        #end
-
-        <input
-            type="radio"
-            #if( $tag.contains($parameters.nameValue, $itemKey) )checked="checked"#end
-            #if ($parameters.name)
-                                        name="$!webwork.htmlEncode($parameters.name)"
-                                        id="$!webwork.htmlEncode($parameters.name)$!webwork.htmlEncode($itemKey)"
-            #end
-            #if ($itemKey)              value="$!webwork.htmlEncode($itemKey)"                #end
-            #if ($parameters.disabled)  disabled="disabled"             #end
-            #if ($parameters.tabindex)  tabindex="$!webwork.htmlEncode($parameters.tabindex)" #end
-            #if ($parameters.onchange)  onchange="$!webwork.htmlEncode($parameters.onchange)" #end
-            #if ($parameters.get('class'))     class="$!webwork.htmlEncode($parameters.get('class'))"   #end
-            #if ($parameters.style)            style="$!webwork.htmlEncode($parameters.style)"          #end
-        />
-        <label for="$!webwork.htmlEncode($parameters.name)$!webwork.htmlEncode($itemKey)">$!itemValue</label>
-
-        #set ($trash = $stack.pop())
-    #end
-#end
-
+#parse("/template/simple/radiomap.vm")
 #parse("/template/xhtml/controlfooter.vm")

File src/java/template/xhtml/select.vm

-#*
-  -- selectmap.vm
-  --
-  -- Required Parameters:
-  --   * label  - The description that will be used to identfy the control.
-  --   * name   - The name of the attribute to put and pull the result from.
-  --              Equates to the NAME parameter of the HTML SELECT tag.
-  --   * list   - Iterator that will provide the options for the control.
-  --              Equates to the HTML OPTION tags in the SELECT and supplies
-  --              both the NAME and VALUE parameters of the OPTION tag.
-  --
-  -- Optional Parameters:
-  --   * labelposition   - determines were the label will be place in relation
-  --                       to the control.  Default is to the left of the control.
-  --   * size            - SIZE parameter of the HTML SELECT tag.
-  --   * disabled        - DISABLED parameter of the HTML SELECT tag.