2
* Copyright 2002-2004 The Apache Software Foundation.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
package org.apache.struts.faces.taglib;
20
import javax.faces.component.UIComponent;
24
* <p>Render an input form that is submitted to a Struts <code>Action</code>,
25
* for the <em>Struts-Faces Integration Library</em>.</p>
27
* @version $Revision: 1.8 $ $Date: 2004/07/26 19:34:49 $
30
public class FormTag extends AbstractFacesTag {
33
// ---------------------------------------------------------- Tag Attributes
37
* <p>The <code>path</code> of the Struts <code>Action</code> to which
38
* this form should be submitted. This property is analogous to the
39
* <code>formName</code> property on the form tag in the standard
42
protected String action = null;
44
public void setAction(String action) {
50
* <p>The content encoding type to use.</p>
52
protected String enctype = null;
54
public void setEnctype(String enctype) {
55
this.enctype = enctype;
60
* <p>The name of the field to which focus should be set when this
61
* form is displayed.</p>
63
protected String focus = null;
65
public void setFocus(String focus) {
71
* <p>The subscript of the focus field array to receive focus.</p>
73
protected String focusIndex = null;
75
public void setFocusIndex(String focusIndex) {
76
this.focusIndex = focusIndex;
81
* <p>The JavaScript reset event handler.</p>
83
protected String onreset = null;
85
public void setOnreset(String onreset) {
86
this.onreset = onreset;
91
* <p>The JavaScript submit event handler.</p>
93
protected String onsubmit = null;
95
public void setOnsubmit(String onsubmit) {
96
this.onsubmit = onsubmit;
101
* <p>The window target for this submit.</p>
103
protected String target = null;
105
public void setTarget(String target) {
106
this.target = target;
110
// ------------------------------------------------------------- Tag Methods
114
* <p>Release any allocated resources.</p>
116
public void release() {
130
// ---------------------------------------------------------- Public Methods
134
* <p>Return the type of component to be created for this tag.</p>
136
public String getComponentType() {
138
return ("org.apache.struts.faces.Form");
144
* <p>Return the <code>rendererType</code> to be used for rendering
147
public String getRendererType() {
149
return ("org.apache.struts.faces.Form");
154
// ------------------------------------------------------- Protected Methods
158
* <p>Override attributes set on this tag instance.</p>
160
* @param component Component whose attributes should be overridden
162
protected void setProperties(UIComponent component) {
164
super.setProperties(component);
165
setStringAttribute(component, "action", action);
166
setStringAttribute(component, "enctype", enctype);
167
setStringAttribute(component, "focus", focus);
168
setStringAttribute(component, "focusIndex", focusIndex);
169
setStringAttribute(component, "onreset", onreset);
170
setStringAttribute(component, "onsubmit", onsubmit);
171
setStringAttribute(component, "target", target);