Commits

Anonymous committed 4c0ca39

Issue number: WW-1256
Obtained from:
Submitted by:
Reviewed by:
First cut on a ww:reset component. No ajax support (would it be reasonable?), some refactorings to come.

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

Comments (0)

Files changed (16)

docs/tags/index.html

 <html>
 <head>
-<title>WebWork 2.2.2-RC1 Taglib Index</title>
+<title>WebWork 2.2.2 Taglib Index</title>
 </head>
 
 <body>
 
-<h1>WebWork 2.2.2-RC1 Taglib Index</h1>
+<h1>WebWork 2.2.2 Taglib Index</h1>
 <p>
 <table width="100%">
 
 
 <tr>
 <td align="left" valign="top" width="20%">
+<a href="Reset.html">&lt;reset /&gt;</a>
+</td>
+<td align="left" valign="top" width="*">
+
+Render a reset button
+
+</td>
+</tr>
+
+<tr>
+<td align="left" valign="top" width="20%">
 <a href="AppendIterator.html">&lt;append /&gt;</a>
 </td>
 <td align="left" valign="top" width="*">

src/java/META-INF/taglib.tld

    </tag>
    <tag>
 
+      <name>reset</name>
+      <tag-class>com.opensymphony.webwork.views.jsp.ui.ResetTag</tag-class>
+      <body-content>JSP</body-content>
+      <description><![CDATA[Render a reset button]]></description>
+
+      <attribute>
+         <name>action</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set action attribute.]]></description>
+
+      </attribute>
+      <attribute>
+         <name>method</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set method attribute.]]></description>
+
+      </attribute>
+      <attribute>
+         <name>align</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[HTML align attribute.]]></description>
+
+      </attribute>
+      <attribute>
+         <name>type</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[The type of reset to use. Valid values are <i>input</i> and <i>button</i>.]]></description>
+
+      </attribute>
+      <attribute>
+         <name>label</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Supply a reset button text apart from reset value. Will have no effect for <i>input</i> type reset, since button text will always be the value parameter.]]></description>
+
+      </attribute>
+      <attribute>
+         <name>theme</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[The theme (other than default) to use for rendering the element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>template</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[The template (other than default) to use for rendering the element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>cssClass</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[The css class to use for element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>cssStyle</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[The css style definitions for element ro use]]></description>
+
+      </attribute>
+      <attribute>
+         <name>title</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html title attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>disabled</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html disabled attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>labelPosition</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[deprecated.]]></description>
+
+      </attribute>
+      <attribute>
+         <name>labelposition</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[define label position of form element (top/left)]]></description>
+
+      </attribute>
+      <attribute>
+         <name>requiredposition</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[define required position of required form element (left|right)]]></description>
+
+      </attribute>
+      <attribute>
+         <name>name</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[The name to set for element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>required</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[If set to true, the rendered element will indicate that input is required]]></description>
+
+      </attribute>
+      <attribute>
+         <name>tabindex</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html tabindex attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>value</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Preset the value of input element.]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onclick</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onclick attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>ondblclick</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html ondblclick attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onmousedown</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onmousedown attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onmouseup</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onmouseup attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onmouseover</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onmouseover attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onmousemove</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onmousemove attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onmouseout</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onmouseout attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onfocus</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onfocus attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onblur</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onblur attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onkeypress</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onkeypress attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onkeydown</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onkeydown attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onkeyup</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onkeyup attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onselect</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onselect attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>onchange</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the html onchange attribute on rendered html element]]></description>
+
+      </attribute>
+      <attribute>
+         <name>tooltip</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the tooltip of this particular component]]></description>
+
+      </attribute>
+      <attribute>
+         <name>tooltipConfig</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[Set the tooltip configuration]]></description>
+
+      </attribute>
+      <attribute>
+         <name>id</name>
+         <required>false</required>
+         <rtexprvalue>true</rtexprvalue>
+
+           <description><![CDATA[id for referencing element. For UI and form tags it will be used as HTML id attribute]]></description>
+
+      </attribute>
+
+   </tag>
+   <tag>
+
       <name>append</name>
       <tag-class>com.opensymphony.webwork.views.jsp.iterator.AppendIteratorTag</tag-class>
       <body-content>JSP</body-content>

src/java/com/opensymphony/webwork/components/Reset.java

+/*
+ * The IT-neering.net Commercial Software License, Version 1.0
+ *
+ * Copyright (c) 2005 Rene Gielen. All rights reserved.
+ *
+ * IT-NEERING.NET PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ *
+ * For more information on IT-neering.net, please see <http://it-neering.net/>.
+ */
+package com.opensymphony.webwork.components;
+
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * <!-- START SNIPPET: javadoc -->
+ * Render a reset button. The reset tag is used together with the form tag to provide form resetting.
+ * The reset can have two different types of rendering:
+ * <ul>
+ * <li>input: renders as html &lt;input type="reset"...&gt;</li>
+ * <li>button: renders as html &lt;button type="reset"...&gt;</li>
+ * </ul>
+ * Please note that the button type has advantages by adding the possibility to seperate the submitted value from the
+ * text shown on the button face, but has issues with Microsoft Internet Explorer at least up to 6.0
+ * <!-- END SNIPPET: javadoc -->
+ *
+ * <p/> <b>Examples</b>
+ *
+ * <pre>
+ * <!-- START SNIPPET: example -->
+ * &lt;ww:reset value="%{'Reset'}" /&gt;
+ * <!-- END SNIPPET: example -->
+ * </pre>
+ *
+ * <pre>
+ * <!-- START SNIPPET: example2 -->
+ * Render an button reset:
+ * &lt;ww:reset type="button" value="%{'Reset'}" label="Rest the form"/&gt;
+ * <!-- END SNIPPET: example2 -->
+ * </pre>
+ *
+ * @author Rene Gielen
+ * @version $Revision$
+ * @since 2.2.2
+ *
+ * @ww.tag name="reset" tld-body-content="JSP" tld-tag-class="com.opensymphony.webwork.views.jsp.ui.ResetTag"
+ * description="Render a reset button"
+ */
+public class Reset extends UIBean {
+    final public static String TEMPLATE = "reset";
+
+    static final String RESETTYPE_INPUT = "input";
+    static final String RESETTYPE_BUTTON = "button";
+
+    protected String action;
+    protected String method;
+    protected String align;
+    protected String type;
+
+    public Reset(OgnlValueStack stack, HttpServletRequest request, HttpServletResponse response) {
+        super(stack, request, response);
+    }
+
+    protected String getDefaultTemplate() {
+        return Reset.TEMPLATE;
+    }
+
+    public void evaluateParams() {
+        if (align == null) {
+            align = "right";
+        }
+
+        String resetType = Reset.RESETTYPE_INPUT;
+        if (type != null && (Reset.RESETTYPE_BUTTON.equalsIgnoreCase(type)) ) {
+            resetType = type;
+        }
+        addParameter("type", resetType);
+
+        if (value == null) {
+            value = "Reset";
+        }
+
+        super.evaluateParams();
+
+        if (!Reset.RESETTYPE_INPUT.equals(resetType) && (label == null)) {
+            addParameter("label", getParameters().get("nameValue"));
+        }
+
+        if (action != null || method != null) {
+            String name;
+
+            if (action != null) {
+                name = "action:" + findString(action);
+
+                if (method != null) {
+                    name += "!" + findString(method);
+                }
+            } else {
+                name = "method:" + findString(method);
+            }
+
+            addParameter("name", name);
+        }
+
+        addParameter("align", findString(align));
+
+    }
+
+    /**
+     * Set action attribute.
+     * @ww.tagattribute required="false" type="String"
+     */
+    public void setAction(String action) {
+        this.action = action;
+    }
+
+    /**
+     * Set method attribute.
+     * @ww.tagattribute required="false" type="String"
+     */
+    public void setMethod(String method) {
+        this.method = method;
+    }
+
+    /**
+     * HTML align attribute.
+     * @ww.tagattribute required="false" type="String"
+     */
+    public void setAlign(String align) {
+        this.align = align;
+    }
+
+    /**
+     * The type of reset to use. Valid values are <i>input</i> and <i>button</i>.
+     * @ww.tagattribute required="false" type="String" default="input"
+     */
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    /**
+     * Supply a reset button text apart from reset value. Will have no effect for <i>input</i> type reset, since button text will always be the value parameter.
+     * @ww.tagattribute required="false"
+     */
+    public void setLabel(String label) {
+        super.setLabel(label);
+    }
+
+}

src/java/com/opensymphony/webwork/views/freemarker/tags/ResetModel.java

+/*
+ * The IT-neering.net Commercial Software License, Version 1.0
+ *
+ * Copyright (c) 2005 Rene Gielen. All rights reserved.
+ *
+ * IT-NEERING.NET PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ *
+ * For more information on IT-neering.net, please see <http://it-neering.net/>.
+ */
+package com.opensymphony.webwork.views.freemarker.tags;
+
+import com.opensymphony.webwork.components.Component;
+import com.opensymphony.webwork.components.Reset;
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @see com.opensymphony.webwork.components.Reset
+ */
+public class ResetModel extends TagModel {
+    public ResetModel(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) {
+        super(stack, req, res);
+    }
+
+    protected Component getBean() {
+        return new Reset(stack, req, res);
+    }
+}

src/java/com/opensymphony/webwork/views/freemarker/tags/WebWorkModels.java

 package com.opensymphony.webwork.views.freemarker.tags;
 
-import com.opensymphony.webwork.components.UpDownSelect;
 import com.opensymphony.xwork.util.OgnlValueStack;
 
 import javax.servlet.http.HttpServletRequest;
     protected SelectModel select;
     protected SetModel set;
     protected SubmitModel submit;
+    protected ResetModel reset;
     protected TabbedPanelModel tabbedPanel;
     protected TextAreaModel textarea;
     protected TextModel text;
         return submit;
     }
 
+    public ResetModel getReset() {
+        if (reset == null) {
+            reset = new ResetModel(stack, req, res);
+        }
+
+        return reset;
+    }
+
     public TextAreaModel getTextarea() {
         if (textarea == null) {
             textarea = new TextAreaModel(stack, req, res);

src/java/com/opensymphony/webwork/views/jsp/ui/ResetTag.java

+/*
+ * The IT-neering.net Commercial Software License, Version 1.0
+ *
+ * Copyright (c) 2005 Rene Gielen. All rights reserved.
+ *
+ * IT-NEERING.NET PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ *
+ * For more information on IT-neering.net, please see <http://it-neering.net/>.
+ */
+package com.opensymphony.webwork.views.jsp.ui;
+
+import com.opensymphony.webwork.components.Component;
+import com.opensymphony.webwork.components.Reset;
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @see com.opensymphony.webwork.components.Reset
+ */
+public class ResetTag extends AbstractUITag {
+    protected String action;
+    protected String method;
+    protected String align;
+    protected String type;
+
+    public Component getBean(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) {
+        return new Reset(stack, req, res);
+    }
+
+    protected void populateParams() {
+        super.populateParams();
+
+        Reset reset = ((Reset) component);
+        reset.setAction(action);
+        reset.setMethod(method);
+        reset.setAlign(align);
+        reset.setType(type);
+    }
+
+    public void setAction(String action) {
+        this.action = action;
+    }
+
+    public void setMethod(String method) {
+        this.method = method;
+    }
+
+    public void setAlign(String align) {
+        this.align = align;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+}

src/java/com/opensymphony/webwork/views/velocity/VelocityManager.java

         addDirective(sb, SelectDirective.class);
         addDirective(sb, SetDirective.class);
         addDirective(sb, SubmitDirective.class);
+        addDirective(sb, ResetDirective.class);
         addDirective(sb, TabbedPanelDirective.class);
         addDirective(sb, TextAreaDirective.class);
         addDirective(sb, TextDirective.class);

src/java/com/opensymphony/webwork/views/velocity/components/ResetDirective.java

+/*
+ * The IT-neering.net Commercial Software License, Version 1.0
+ *
+ * Copyright (c) 2005 Rene Gielen. All rights reserved.
+ *
+ * IT-NEERING.NET PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ *
+ * For more information on IT-neering.net, please see <http://it-neering.net/>.
+ */
+package com.opensymphony.webwork.views.velocity.components;
+
+import com.opensymphony.webwork.components.Component;
+import com.opensymphony.webwork.components.Reset;
+import com.opensymphony.xwork.util.OgnlValueStack;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @see com.opensymphony.webwork.components.Reset
+ */
+public class ResetDirective extends AbstractDirective {
+    public String getBeanName() {
+        return "reset";
+    }
+
+    protected Component getBean(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) {
+        return new Reset(stack, req, res);
+    }
+}

src/java/template/css_xhtml/reset.ftl

+<div <#rt/>
+<#if parameters.align?exists>
+    align="${parameters.align?html}"<#t/>
+</#if>
+<#if parameters.id?exists>
+    id="wwctrl_${parameters.id}"<#rt/>
+</#if>
+><#t/>
+<#include "/${parameters.templateDir}/simple/reset.ftl" />
+</div><#t/>

src/java/template/simple/reset.ftl

+<#if parameters.type?exists && parameters.type=="button">
+<button type="reset"<#rt/>
+<#if parameters.name?exists>
+ name="${parameters.name?html}"<#rt/>
+</#if>
+<#if parameters.nameValue?exists>
+ value="<@ww.property value="parameters.nameValue"/>"<#rt/>
+</#if>
+<#if parameters.cssClass?exists>
+ class="${parameters.cssClass?html}"<#rt/>
+</#if>
+<#if parameters.cssStyle?exists>
+ style="${parameters.cssStyle?html}"<#rt/>
+</#if>
+<#include "/${parameters.templateDir}/simple/scripting-events.ftl"/>
+><#if parameters.label?exists><@ww.property value="parameters.label"/><#rt/></#if></button>
+<#else>
+<input type="reset"<#rt/>
+<#if parameters.name?exists>
+ name="${parameters.name?html}"<#rt/>
+</#if>
+<#if parameters.nameValue?exists>
+ value="<@ww.property value="parameters.nameValue"/>"<#rt/>
+</#if>
+<#if parameters.cssClass?exists>
+ class="${parameters.cssClass?html}"<#rt/>
+</#if>
+<#if parameters.cssStyle?exists>
+ style="${parameters.cssStyle?html}"<#rt/>
+</#if>
+<#if parameters.title?exists>
+ title="${parameters.title?html}"<#rt/>
+</#if>
+<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
+/>
+</#if>

src/java/template/xhtml/reset.ftl

+<tr>
+    <td colspan="2"><div <#rt/>
+<#if parameters.align?exists>
+    align="${parameters.align?html}"<#t/>
+</#if>
+><#t/>
+<#include "/${parameters.templateDir}/simple/reset.ftl" />
+</div><#t/>
+<#include "/${parameters.templateDir}/xhtml/controlfooter.ftl" />

src/test/com/opensymphony/webwork/views/jsp/ui/Reset-1.txt

+<tr>
+    <td colspan="2"><div align="left"><input type="reset" name="myname" value="bar"/></div></td>
+</tr>

src/test/com/opensymphony/webwork/views/jsp/ui/Reset-2.txt

+<tr>
+    <td colspan="2"><div align="right"><input type="reset" name="myname" value="Reset" title="mytitle"/></div></td>
+</tr>

src/test/com/opensymphony/webwork/views/jsp/ui/Reset-3.txt

+<tr>
+    <td colspan="2"><div align="right"><button type="reset" name="myname" value="bar">bar</button></div></td>
+</tr>

src/test/com/opensymphony/webwork/views/jsp/ui/Reset-4.txt

+<tr>
+    <td colspan="2"><div align="left"><button type="reset" name="myname" value="bar">mylabel</button></div></td>
+</tr>

src/test/com/opensymphony/webwork/views/jsp/ui/ResetTest.java

+/*
+ * The IT-neering.net Commercial Software License, Version 1.0
+ *
+ * Copyright (c) 2005 Rene Gielen. All rights reserved.
+ *
+ * IT-NEERING.NET PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ *
+ * For more information on IT-neering.net, please see <http://it-neering.net/>.
+ */
+package com.opensymphony.webwork.views.jsp.ui;
+
+import com.opensymphony.webwork.TestAction;
+import com.opensymphony.webwork.views.jsp.AbstractUITagTest;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Reset Component Test.
+ *
+ * @author Rene Gielen
+ */
+public class ResetTest extends AbstractUITagTest {
+
+    public void testDefaultValues() throws Exception {
+        TestAction testAction = (TestAction) action;
+        testAction.setFoo("bar");
+
+        ResetTag tag = new ResetTag();
+        tag.setPageContext(pageContext);
+        tag.setLabel("mylabel");
+        tag.setName("myname");
+        tag.setTitle("mytitle");
+
+        tag.doStartTag();
+        tag.doEndTag();
+
+        verify(TextFieldTag.class.getResource("Reset-2.txt"));
+    }
+
+    public void testSimple() throws Exception {
+        TestAction testAction = (TestAction) action;
+        testAction.setFoo("bar");
+
+        ResetTag tag = new ResetTag();
+        tag.setPageContext(pageContext);
+        tag.setLabel("mylabel");
+        tag.setAlign("left");
+        tag.setName("myname");
+        tag.setValue("%{foo}");
+
+        tag.doStartTag();
+        tag.doEndTag();
+
+        verify(TextFieldTag.class.getResource("Reset-1.txt"));
+    }
+
+    public void testButtonSimple() throws Exception {
+        TestAction testAction = (TestAction) action;
+        testAction.setFoo("bar");
+
+        ResetTag tag = new ResetTag();
+        tag.setPageContext(pageContext);
+        tag.setType("button");
+        tag.setName("myname");
+        tag.setValue("%{foo}");
+
+        tag.doStartTag();
+        tag.doEndTag();
+
+        verify(TextFieldTag.class.getResource("Reset-3.txt"));
+    }
+
+    public void testButtonWithLabel() throws Exception {
+        TestAction testAction = (TestAction) action;
+        testAction.setFoo("bar");
+
+        ResetTag tag = new ResetTag();
+        tag.setPageContext(pageContext);
+        tag.setLabel("mylabel");
+        tag.setType("button");
+        tag.setAlign("left");
+        tag.setName("myname");
+        tag.setValue("%{foo}");
+
+        tag.doStartTag();
+        tag.doEndTag();
+
+        verify(TextFieldTag.class.getResource("Reset-4.txt"));
+    }
+
+    /**
+     * Initialize a map of {@link com.opensymphony.webwork.views.jsp.AbstractUITagTest.PropertyHolder} for generic tag
+     * property testing. Will be used when calling {@link #verifyGenericProperties(AbstractUITag,
+     * String, String[])} as properties to verify.<p/> This implementation extends testdata from AbstractUITag.
+     *
+     * @return A Map of PropertyHolders values bound to {@link com.opensymphony.webwork.views.jsp.AbstractUITagTest.PropertyHolder#getName()}
+     *         as key.
+     */
+    protected Map initializedGenericTagTestProperties() {
+        Map result = new HashMap();
+        new PropertyHolder("title", "someTitle").addToMap(result);
+        new PropertyHolder("cssClass", "cssClass1", "class=\"cssClass1\"").addToMap(result);
+        new PropertyHolder("cssStyle", "cssStyle1", "style=\"cssStyle1\"").addToMap(result);
+        new PropertyHolder("name", "someName").addToMap(result);
+        new PropertyHolder("value", "someValue").addToMap(result);
+        return result;
+    }
+
+    public void testGenericSimple() throws Exception {
+        ResetTag tag = new ResetTag();
+        verifyGenericProperties(tag, "simple", null);
+    }
+
+    public void testGenericXhtml() throws Exception {
+        ResetTag tag = new ResetTag();
+        verifyGenericProperties(tag, "xhtml", null);
+    }
+
+    public void testGenericAjax() throws Exception {
+        ResetTag tag = new ResetTag();
+        verifyGenericProperties(tag, "ajax", null);
+    }
+
+}