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 org.dbforms.util.Util; 31 32 import javax.servlet.jsp.JspException ; 33 34 35 36 42 public class DbNavCopyButtonTag extends DbBaseButtonTag 43 implements javax.servlet.jsp.tagext.TryCatchFinally { 44 45 private String showAlwaysInFooter = "true"; 46 47 52 public void setShowAlwaysInFooter(String string) { 53 showAlwaysInFooter = string; 54 } 55 56 57 62 public String getShowAlwaysInFooter() { 63 return showAlwaysInFooter; 64 } 65 66 67 70 public void doCatch(Throwable t) throws Throwable { 71 throw t; 72 } 73 74 75 78 public void doFinally() { 79 showAlwaysInFooter = "true"; 80 super.doFinally(); 81 } 82 83 84 92 public int doStartTag() throws javax.servlet.jsp.JspException { 93 super.doStartTag(); 94 95 if (getParentForm() 96 .isFooterReached() 97 && ResultSetVector.isNull(getParentForm().getResultSetVector()) 98 && !Util.getTrue(showAlwaysInFooter)) { 99 return SKIP_BODY; 101 } 102 103 try { 104 StringBuffer tagBuf = new StringBuffer (); 105 String tagName = EventType.EVENT_NAVIGATION_TRANSFER_COPY 106 + getTable() 107 .getId() + "_" 108 + Integer.toString(getUniqueID()); 109 110 if (getFollowUp() != null) { 111 tagBuf.append(getDataTag(tagName, "fu", getFollowUp())); 112 } 113 114 if (getFollowUpOnError() != null) { 115 tagBuf.append(getDataTag(tagName, "fue", getFollowUpOnError())); 116 } 117 118 tagBuf.append(getButtonBegin()); 119 tagBuf.append(" name=\""); 120 tagBuf.append(tagName); 121 tagBuf.append(getButtonEnd()); 122 123 pageContext.getOut() 124 .write(tagBuf.toString()); 125 } catch (java.io.IOException ioe) { 126 throw new JspException ("IO Error: " + ioe.getMessage()); 127 } 128 129 if (getChoosenFlavor() == FLAVOR_MODERN) { 130 return EVAL_BODY_BUFFERED; 131 } else { 132 return SKIP_BODY; 133 } 134 } 135 } 136 | Popular Tags |