1 33 34 package com.icesoft.faces.component.ext.renderkit; 35 36 import com.icesoft.faces.component.ext.HtmlCommandButton; 37 import org.w3c.dom.Element ; 38 39 import javax.faces.component.UIComponent; 40 41 42 public class ButtonRenderer 43 extends com.icesoft.faces.renderkit.dom_html_basic.ButtonRenderer { 44 45 protected void renderOnClick(UIComponent uiComponent, Element root) { 46 HtmlCommandButton button = (HtmlCommandButton) uiComponent; 47 String onclick = (String ) uiComponent.getAttributes().get("onclick"); 48 String submitCode; 49 if (button.getPartialSubmit()) { 50 submitCode = this.ICESUBMITPARTIAL + "return false;"; 51 } else { 52 submitCode = this.ICESUBMIT + "return false;"; 53 } 54 if (onclick == null) { 55 onclick = submitCode; 56 } else { 57 onclick += submitCode; 58 } 59 root.setAttribute("onclick", onclick); 60 61 } 62 63 } 64 | Popular Tags |