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.event.eventtype.EventType;
27
28 import org.dbforms.util.Util;
29
30 import javax.servlet.jsp.JspException;
31
32
33
34 /***
35 * this tag renders an "reload"-button.
36 *
37 * @author Henner Kollmann
38 */
39 public class DbNavReloadButtonTag extends AbstractDbBaseButtonTag
40 implements javax.servlet.jsp.tagext.TryCatchFinally {
41 private String forceReload = null;
42
43 /***
44 * DOCUMENT ME!
45 *
46 * @param string
47 */
48 public void setForceReload(String string) {
49 forceReload = string;
50 }
51
52
53 /***
54 * DOCUMENT ME!
55 *
56 * @return
57 */
58 public String getForceReload() {
59 return forceReload;
60 }
61
62
63 /***
64 * DOCUMENT ME!
65 */
66 public void doFinally() {
67 super.doFinally();
68 }
69
70
71 /***
72 * DOCUMENT ME!
73 *
74 * @return DOCUMENT ME!
75 *
76 * @throws javax.servlet.jsp.JspException DOCUMENT ME!
77 * @throws JspException DOCUMENT ME!
78 */
79 public int doStartTag() throws javax.servlet.jsp.JspException {
80 super.doStartTag();
81
82 try {
83 StringBuffer tagBuf = new StringBuffer();
84 StringBuffer tagName = new StringBuffer(EventType.EVENT_NAVIGATION_TRANSFER_RELOAD);
85
86 if (getTable() != null) {
87 tagName.append(getTable().getId());
88 }
89
90 if (hasForceReloadSet()) {
91 tagName.append("_force");
92 } else if (getParentForm()
93 .isFooterReached()) {
94
95 }
96
97 tagName.append("_");
98 tagName.append(Integer.toString(getUniqueID()));
99
100 if (getFollowUp() != null) {
101 tagBuf.append(getDataTag(tagName.toString(), "fu", getFollowUp()));
102 }
103
104 if (getFollowUpOnError() != null) {
105 tagBuf.append(getDataTag(tagName.toString(), "fue",
106 getFollowUpOnError()));
107 }
108
109 tagBuf.append(getButtonBegin());
110 tagBuf.append(" name=\"");
111 tagBuf.append(tagName);
112 tagBuf.append(getButtonEnd());
113
114 pageContext.getOut()
115 .write(tagBuf.toString());
116 } catch (java.io.IOException ioe) {
117 throw new JspException("IO Error: " + ioe.getMessage());
118 }
119
120 if (getChoosenFlavor() == FLAVOR_MODERN) {
121 return EVAL_BODY_BUFFERED;
122 } else {
123 return SKIP_BODY;
124 }
125 }
126
127
128 /***
129 * DOCUMENT ME!
130 *
131 * @return DOCUMENT ME!
132 */
133 public boolean hasForceReloadSet() {
134 return Util.getTrue(forceReload);
135 }
136 }