001: //** Copyright Statement ***************************************************
002: //The Salmon Open Framework for Internet Applications (SOFIA)
003: // Copyright (C) 1999 - 2002, Salmon LLC
004: //
005: // This program is free software; you can redistribute it and/or
006: // modify it under the terms of the GNU General Public License version 2
007: // as published by the Free Software Foundation;
008: //
009: // This program is distributed in the hope that it will be useful,
010: // but WITHOUT ANY WARRANTY; without even the implied warranty of
011: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: // GNU General Public License for more details.
013: //
014: // You should have received a copy of the GNU General Public License
015: // along with this program; if not, write to the Free Software
016: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
017: //
018: // For more information please visit http://www.salmonllc.com
019: //** End Copyright Statement ***************************************************
020: package com.salmonllc.wml.tags;
021:
022: /////////////////////////
023: //$Archive: /SOFIA/SourceCode/com/salmonllc/wml/tags/SubmitTag.java $
024: //$Author: Dan $
025: //$Revision: 5 $
026: //$Modtime: 6/11/03 4:30p $
027: /////////////////////////
028:
029: import com.salmonllc.html.HtmlComponent;
030: import com.salmonllc.jsp.tags.BaseEmptyTag;
031: import com.salmonllc.wml.WmlSubmit;
032:
033: /**
034: * This is a tag used to create a Wml Anchor which will act as a submit.
035: */
036:
037: public class SubmitTag extends BaseEmptyTag {
038: private String _dataSource;
039: private String _title;
040: private String _classname;
041:
042: /**
043: * This method creates the WmlSubmit used by the tag.
044: */
045:
046: public HtmlComponent createComponent() {
047: WmlSubmit submit = new WmlSubmit(getName(), getHelper()
048: .getController());
049: CardTag cTag = (CardTag) findAncestorWithClass(this ,
050: CardTag.class);
051: submit.setCard(cTag.getCard());
052: if (_title != null)
053: submit.setTitle(_title);
054: if (_classname != null)
055: submit.setClassName(_classname);
056: if (_dataSource != null)
057: submit.setDataSource(_dataSource);
058: return submit;
059: }
060:
061: /**
062: * Get the Data Source the component should be bound to
063: */
064: public String getDatasource() {
065: return _dataSource;
066: }
067:
068: /**
069: * Get the tag's title attribute
070: */
071: public String getTitle() {
072: return _title;
073: }
074:
075: /**
076: * Get the tag's classname attribute
077: */
078: public String getClassname() {
079: return _classname;
080: }
081:
082: /**
083: * Set the Data Source the component should be bound to
084: */
085: public void setDatasource(String val) {
086: _dataSource = val;
087: }
088:
089: /**
090: * Sets the tag's title attribute
091: */
092: public void setTitle(String val) {
093: _title = val;
094: }
095:
096: /**
097: * Sets the tag's classname attribute
098: */
099: public void setClassname(String val) {
100: _classname = val;
101: }
102:
103: }
|