1 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 39 public class DbNavReloadButtonTag extends DbBaseButtonTag 40 implements javax.servlet.jsp.tagext.TryCatchFinally { 41 private String forceReload = null; 42 43 48 public void setForceReload(String string) { 49 forceReload = string; 50 } 51 52 53 58 public String getForceReload() { 59 return forceReload; 60 } 61 62 63 66 public void doCatch(Throwable t) throws Throwable { 67 throw t; 68 } 69 70 71 74 public void doFinally() { 75 super.doFinally(); 76 } 77 78 79 87 public int doStartTag() throws javax.servlet.jsp.JspException { 88 super.doStartTag(); 89 90 try { 91 StringBuffer tagBuf = new StringBuffer (); 92 StringBuffer tagName = new StringBuffer (EventType.EVENT_NAVIGATION_TRANSFER_RELOAD); 93 94 if (getTable() != null) { 95 tagName.append(getTable().getId()); 96 } 97 98 if (hasForceReloadSet()) { 99 tagName.append("_force"); 100 } else if (getParentForm() 101 .isFooterReached()) { 102 tagName.append("_ins"); 103 } 104 105 tagName.append("_"); 106 tagName.append(Integer.toString(getUniqueID())); 107 108 if (getFollowUp() != null) { 109 tagBuf.append(getDataTag(tagName.toString(), "fu", getFollowUp())); 110 } 111 112 if (getFollowUpOnError() != null) { 113 tagBuf.append(getDataTag(tagName.toString(), "fue", 114 getFollowUpOnError())); 115 } 116 117 tagBuf.append(getButtonBegin()); 118 tagBuf.append(" name=\""); 119 tagBuf.append(tagName); 120 tagBuf.append(getButtonEnd()); 121 122 pageContext.getOut() 123 .write(tagBuf.toString()); 124 } catch (java.io.IOException ioe) { 125 throw new JspException ("IO Error: " + ioe.getMessage()); 126 } 127 128 if (getChoosenFlavor() == FLAVOR_MODERN) { 129 return EVAL_BODY_BUFFERED; 130 } else { 131 return SKIP_BODY; 132 } 133 } 134 135 136 141 public boolean hasForceReloadSet() { 142 return Util.getTrue(forceReload); 143 } 144 } 145 | Popular Tags |