1 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 39 public class DbNavNextButtonTag extends DbBaseButtonTag 40 implements javax.servlet.jsp.tagext.TryCatchFinally { 41 private String stepWidth; 42 43 48 public void setStepWidth(String stepWidth) { 49 this.stepWidth = stepWidth; 50 } 51 52 53 58 public String getStepWidth() { 59 return stepWidth; 60 } 61 62 63 66 public void doCatch(Throwable t) throws Throwable { 67 throw t; 68 } 69 70 71 74 public void doFinally() { 75 stepWidth = null; 76 super.doFinally(); 77 } 78 79 80 88 public int doStartTag() throws javax.servlet.jsp.JspException { 89 super.doStartTag(); 90 91 if (getParentForm() 92 .isFooterReached() 93 && ResultSetVector.isNull(getParentForm().getResultSetVector())) { 94 return SKIP_BODY; 96 } 97 98 boolean isLastPage = getParentForm() 99 .getResultSetVector() 100 .isLastPage(); 101 102 try { 103 if (isLastPage && "nohtml".equals(getDisabledBehaviour())) { 105 return SKIP_BODY; 106 } else if (isLastPage && "altimage".equals(getDisabledBehaviour())) { 107 pageContext.getOut() 108 .write(getDisabledImage()); 109 110 return SKIP_BODY; 111 } 112 else { 114 StringBuffer tagBuf = new StringBuffer (); 115 String tagName = EventType.EVENT_NAVIGATION_TRANSFER_NEXT 116 + getTable() 117 .getId() + "_" 118 + Integer.toString(getUniqueID()); 119 120 if (stepWidth != null) { 121 tagBuf.append(getDataTag(tagName, "sw", stepWidth)); 122 } 123 124 if (getFollowUp() != null) { 125 tagBuf.append(getDataTag(tagName, "fu", getFollowUp())); 126 } 127 128 if (getFollowUpOnError() != null) { 129 tagBuf.append(getDataTag(tagName, "fue", getFollowUpOnError())); 130 } 131 132 tagBuf.append(getButtonBegin()); 133 134 if (isLastPage) { 135 tagBuf.append(" disabled=\"true\""); 136 } 137 138 tagBuf.append(" name=\""); 139 tagBuf.append(tagName); 140 tagBuf.append(getButtonEnd()); 141 142 pageContext.getOut() 143 .write(tagBuf.toString()); 144 } 145 } catch (java.io.IOException ioe) { 146 throw new JspException ("IO Error: " + ioe.getMessage()); 147 } 148 149 if (getChoosenFlavor() == FLAVOR_MODERN) { 150 return EVAL_BODY_BUFFERED; 151 } else { 152 return SKIP_BODY; 153 } 154 } 155 } 156 | Popular Tags |