FileDocCategorySizeDatePackage
Reset.javaAPI DocExample3551Mon Jul 23 13:26:36 BST 2007org.apache.struts2.components

Reset

public class Reset extends FormButton
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:
  • input: renders as html <input type="reset"...>
  • button: renders as html <button type="reset"...>
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

Examples


<s:reset value="Reset" />


Render an button reset:
<s:reset type="button" key="reset"/>

Fields Summary
public static final String
TEMPLATE
protected String
action
protected String
method
protected String
align
protected String
type
Constructors Summary
public Reset(com.opensymphony.xwork2.util.ValueStack stack, HttpServletRequest request, HttpServletResponse response)


           
        super(stack, request, response);
    
Methods Summary
public voidevaluateParams()


        if ((key == null) && (value == null)) {
            value = "Reset";
        }

        if (((key != null)) && (value == null)) {
            this.value = "%{getText('"+key +"')}";
        }

        super.evaluateParams();

    
protected java.lang.StringgetDefaultTemplate()

        return Reset.TEMPLATE;
    
public voidsetLabel(java.lang.String label)

        super.setLabel(label);
    
protected booleansupportsImageType()
Indicate whether the concrete button supports the type "image".

return
false to indicate type image is supported.

        return false;