001: /*
002: * $Id: SubmitTag.java 508280 2007-02-16 02:07:56Z musachy $
003: *
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021: package org.apache.struts2.views.jsp.ui;
022:
023: import javax.servlet.http.HttpServletRequest;
024: import javax.servlet.http.HttpServletResponse;
025:
026: import org.apache.struts2.components.Component;
027: import org.apache.struts2.components.Submit;
028:
029: import com.opensymphony.xwork2.util.ValueStack;
030:
031: /**
032: * @see Submit
033: */
034: public class SubmitTag extends AbstractUITag {
035:
036: private static final long serialVersionUID = 2179281109958301343L;
037:
038: protected String action;
039: protected String method;
040: protected String align;
041: protected String type;
042: protected String href;
043: protected String listenTopics;
044: protected String notifyTopics;
045: protected String loadingText;
046: protected String errorText;
047: protected String executeScripts;
048: protected String handler;
049: protected String formId;
050: protected String formFilter;
051: protected String src;
052: protected String showErrorTransportText;
053: protected String indicator;
054: protected String showLoadingText;
055:
056: //these two are called "preInvokeJS" and "onLoadJS" on the tld
057: //Names changed here to keep some consistency
058: protected String beforeLoading;
059: protected String afterLoading;
060:
061: //this one is called "resultDivId" on the tld
062: protected String targets;
063:
064: public Component getBean(ValueStack stack, HttpServletRequest req,
065: HttpServletResponse res) {
066: return new Submit(stack, req, res);
067: }
068:
069: protected void populateParams() {
070: super .populateParams();
071:
072: Submit submit = ((Submit) component);
073: submit.setAction(action);
074: submit.setMethod(method);
075: submit.setAlign(align);
076: submit.setType(type);
077: submit.setHref(href);
078: submit.setListenTopics(listenTopics);
079: submit.setLoadingText(loadingText);
080: submit.setErrorText(errorText);
081: submit.setAfterLoading(afterLoading);
082: submit.setBeforeLoading(beforeLoading);
083: submit.setExecuteScripts(executeScripts);
084: submit.setHandler(handler);
085: submit.setFormFilter(formFilter);
086: submit.setFormId(formId);
087: submit.setSrc(src);
088: submit.setTargets(targets);
089: submit.setNotifyTopics(notifyTopics);
090: submit.setShowErrorTransportText(showErrorTransportText);
091: submit.setIndicator(indicator);
092: submit.setShowLoadingText(showLoadingText);
093: }
094:
095: public void setAction(String action) {
096: this .action = action;
097: }
098:
099: public void setMethod(String method) {
100: this .method = method;
101: }
102:
103: public void setAlign(String align) {
104: this .align = align;
105: }
106:
107: public String getType() {
108: return type;
109: }
110:
111: public void setType(String type) {
112: this .type = type;
113: }
114:
115: public void setHref(String href) {
116: this .href = href;
117: }
118:
119: public void setErrorText(String errorText) {
120: this .errorText = errorText;
121: }
122:
123: public void setLoadingText(String loadingText) {
124: this .loadingText = loadingText;
125: }
126:
127: public void setListenTopics(String listenTopics) {
128: this .listenTopics = listenTopics;
129: }
130:
131: public void setExecuteScripts(String executeScripts) {
132: this .executeScripts = executeScripts;
133: }
134:
135: public void setHandler(String handler) {
136: this .handler = handler;
137: }
138:
139: public void setFormFilter(String formFilter) {
140: this .formFilter = formFilter;
141: }
142:
143: public void setFormId(String formId) {
144: this .formId = formId;
145: }
146:
147: public void setSrc(String src) {
148: this .src = src;
149: }
150:
151: public void setTargets(String targets) {
152: this .targets = targets;
153: }
154:
155: @Deprecated
156: public void setResultDivId(String id) {
157: this .targets = id;
158: }
159:
160: @Deprecated
161: public void setOnLoadJS(String postJS) {
162: this .afterLoading = postJS;
163: }
164:
165: @Deprecated
166: public void setPreInvokeJS(String preJS) {
167: this .beforeLoading = preJS;
168: }
169:
170: public void setNotifyTopics(String notifyTopics) {
171: this .notifyTopics = notifyTopics;
172: }
173:
174: public void setShowErrorTransportText(String showErrorTransportText) {
175: this .showErrorTransportText = showErrorTransportText;
176: }
177:
178: public void setIndicator(String indicator) {
179: this .indicator = indicator;
180: }
181:
182: public void setShowLoadingText(String showLoadingText) {
183: this.showLoadingText = showLoadingText;
184: }
185: }
|