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 DbNavFirstButtonTag extends DbBaseButtonTag 40 implements javax.servlet.jsp.tagext.TryCatchFinally { 41 44 public void doCatch(Throwable t) throws Throwable { 45 throw t; 46 } 47 48 49 52 public void doFinally() { 53 super.doFinally(); 54 } 55 56 57 65 public int doStartTag() throws javax.servlet.jsp.JspException { 66 super.doStartTag(); 67 68 if (getParentForm() 69 .isFooterReached() 70 && ResultSetVector.isNull(getParentForm().getResultSetVector())) { 71 return SKIP_BODY; 73 } 74 75 boolean isFirstPage = getParentForm() 76 .getResultSetVector() 77 .isFirstPage(); 78 79 try { 80 if (isFirstPage && "nohtml".equals(getDisabledBehaviour())) { 82 return SKIP_BODY; 83 } else if (isFirstPage && "altimage".equals(getDisabledBehaviour())) { 84 pageContext.getOut() 85 .write(getDisabledImage()); 86 87 return SKIP_BODY; 88 } 89 else { 91 StringBuffer tagBuf = new StringBuffer (); 92 String tagName = EventType.EVENT_NAVIGATION_TRANSFER_FIRST 93 + getTable() 94 .getId() + "_" 95 + Integer.toString(getUniqueID()); 96 97 if (getFollowUp() != null) { 98 tagBuf.append(getDataTag(tagName, "fu", getFollowUp())); 99 } 100 101 if (getFollowUpOnError() != null) { 102 tagBuf.append(getDataTag(tagName, "fue", getFollowUpOnError())); 103 } 104 105 tagBuf.append(getButtonBegin()); 106 107 if (isFirstPage) { 108 tagBuf.append(" disabled=\"true\""); 109 } 110 111 tagBuf.append(" name=\""); 112 tagBuf.append(tagName); 113 tagBuf.append(getButtonEnd()); 114 115 pageContext.getOut() 116 .write(tagBuf.toString()); 117 } 118 } catch (java.io.IOException ioe) { 119 throw new JspException ("IO Error: " + ioe.getMessage()); 120 } 121 122 if (getChoosenFlavor() == FLAVOR_MODERN) { 123 return EVAL_BODY_BUFFERED; 124 } else { 125 return SKIP_BODY; 126 } 127 } 128 } 129 | Popular Tags |