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 javax.servlet.jsp.JspException;
31
32
33
34 /***
35 * this tag renders a "next"-button.
36 *
37 * @author Joachim Peer
38 */
39 public class DbNavNextButtonTag extends AbstractDbBaseButtonTag
40 implements javax.servlet.jsp.tagext.TryCatchFinally {
41 private String stepWidth;
42
43 /***
44 * DOCUMENT ME!
45 *
46 * @param stepWidth DOCUMENT ME!
47 */
48 public void setStepWidth(String stepWidth) {
49 this.stepWidth = stepWidth;
50 }
51
52
53 /***
54 * DOCUMENT ME!
55 *
56 * @return DOCUMENT ME!
57 */
58 public String getStepWidth() {
59 return stepWidth;
60 }
61
62
63 /***
64 * DOCUMENT ME!
65 */
66 public void doFinally() {
67 stepWidth = null;
68 super.doFinally();
69 }
70
71
72 /***
73 * DOCUMENT ME!
74 *
75 * @return DOCUMENT ME!
76 *
77 * @throws javax.servlet.jsp.JspException DOCUMENT ME!
78 * @throws JspException DOCUMENT ME!
79 */
80 public int doStartTag() throws javax.servlet.jsp.JspException {
81 super.doStartTag();
82
83 if (getParentForm()
84 .isFooterReached()
85 && ResultSetVector.isNull(getParentForm().getResultSetVector())) {
86
87 return SKIP_BODY;
88 }
89
90 boolean isLastPage = getParentForm()
91 .getResultSetVector()
92 .isLastPage();
93
94 try {
95
96 if (isLastPage && "nohtml".equals(getDisabledBehaviour())) {
97 return SKIP_BODY;
98 } else if (isLastPage && "altimage".equals(getDisabledBehaviour())) {
99 pageContext.getOut()
100 .write(getDisabledImage());
101
102 return SKIP_BODY;
103 }
104
105 else {
106 StringBuffer tagBuf = new StringBuffer();
107 String tagName = EventType.EVENT_NAVIGATION_TRANSFER_NEXT
108 + getTable()
109 .getId() + "_"
110 + Integer.toString(getUniqueID());
111
112 if (stepWidth != null) {
113 tagBuf.append(getDataTag(tagName, "sw", stepWidth));
114 }
115
116 if (getFollowUp() != null) {
117 tagBuf.append(getDataTag(tagName, "fu", getFollowUp()));
118 }
119
120 if (getFollowUpOnError() != null) {
121 tagBuf.append(getDataTag(tagName, "fue", getFollowUpOnError()));
122 }
123
124 tagBuf.append(getButtonBegin());
125
126 if (isLastPage) {
127 tagBuf.append(" disabled=\"true\"");
128 }
129
130 tagBuf.append(" name=\"");
131 tagBuf.append(tagName);
132 tagBuf.append(getButtonEnd());
133
134 pageContext.getOut()
135 .write(tagBuf.toString());
136 }
137 } catch (java.io.IOException ioe) {
138 throw new JspException("IO Error: " + ioe.getMessage());
139 }
140
141 if (getChoosenFlavor() == FLAVOR_MODERN) {
142 return EVAL_BODY_BUFFERED;
143 } else {
144 return SKIP_BODY;
145 }
146 }
147 }