1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.dbforms.taglib;
25
26 import org.dbforms.config.ResultSetVector;
27
28 import org.dbforms.event.eventtype.EventType;
29
30 import org.dbforms.util.Util;
31
32 import javax.servlet.jsp.JspException;
33
34
35
36 /***
37 * this tag renders an "copy"-button.
38 *
39 * @author Stefano Borghi
40 * @version $Revision: 1.17 $
41 */
42 public class DbNavCopyButtonTag extends AbstractDbBaseButtonTag
43 implements javax.servlet.jsp.tagext.TryCatchFinally {
44 /*** Holds value of property showAlwaysInFooter. */
45 private String showAlwaysInFooter = "true";
46
47 /***
48 * DOCUMENT ME!
49 *
50 * @param string
51 */
52 public void setShowAlwaysInFooter(String string) {
53 showAlwaysInFooter = string;
54 }
55
56
57 /***
58 * DOCUMENT ME!
59 *
60 * @return
61 */
62 public String getShowAlwaysInFooter() {
63 return showAlwaysInFooter;
64 }
65
66
67 /***
68 * DOCUMENT ME!
69 */
70 public void doFinally() {
71 showAlwaysInFooter = "true";
72 super.doFinally();
73 }
74
75
76 /***
77 * DOCUMENT ME!
78 *
79 * @return DOCUMENT ME!
80 *
81 * @throws javax.servlet.jsp.JspException DOCUMENT ME!
82 * @throws JspException DOCUMENT ME!
83 */
84 public int doStartTag() throws javax.servlet.jsp.JspException {
85 super.doStartTag();
86
87 if (getParentForm()
88 .isFooterReached()
89 && ResultSetVector.isNull(getParentForm().getResultSetVector())
90 && !Util.getTrue(showAlwaysInFooter)) {
91
92 return SKIP_BODY;
93 }
94
95 try {
96 StringBuffer tagBuf = new StringBuffer();
97 String tagName = EventType.EVENT_NAVIGATION_TRANSFER_COPY
98 + getTable()
99 .getId() + "_"
100 + Integer.toString(getUniqueID());
101
102 if (getFollowUp() != null) {
103 tagBuf.append(getDataTag(tagName, "fu", getFollowUp()));
104 }
105
106 if (getFollowUpOnError() != null) {
107 tagBuf.append(getDataTag(tagName, "fue", getFollowUpOnError()));
108 }
109
110 tagBuf.append(getButtonBegin());
111 tagBuf.append(" name=\"");
112 tagBuf.append(tagName);
113 tagBuf.append(getButtonEnd());
114
115 pageContext.getOut()
116 .write(tagBuf.toString());
117 } catch (java.io.IOException ioe) {
118 throw new JspException("IO Error: " + ioe.getMessage());
119 }
120
121 if (getChoosenFlavor() == FLAVOR_MODERN) {
122 return EVAL_BODY_BUFFERED;
123 } else {
124 return SKIP_BODY;
125 }
126 }
127 }