public HtmlForm() { super(); setRendererType("javax.faces.Form"); handleAttribute("enctype", "application/x-www-form-urlencoded"); }
/** * <p>Set the value of the <code>onmousedown</code> property.</p> * @param onmousedown the new property value */ public void setOnmousedown(java.lang.String onmousedown) { getStateHelper().put(PropertyKeys.onmousedown, onmousedown); handleAttribute("onmousedown", onmousedown); }
public HtmlForm getLoginForm() { if(loginForm == null) { //first call to this method. loginForm = new HtmlForm(); } return loginForm; }
private void handleAttribute(String name, Object value) { List<String> setAttributes = (List<String>) this.getAttributes().get("javax.faces.component.UIComponentBase.attributesThatAreSet"); if (setAttributes == null) { String cname = this.getClass().getName(); if (cname != null && cname.startsWith(OPTIMIZED_PACKAGE)) { setAttributes = new ArrayList<String>(6); this.getAttributes().put("javax.faces.component.UIComponentBase.attributesThatAreSet", setAttributes); } } if (setAttributes != null) { if (value == null) { ValueExpression ve = getValueExpression(name); if (ve == null) { setAttributes.remove(name); } } else if (!setAttributes.contains(name)) { setAttributes.add(name); } } }
/** * Gets Script to be invoked when the element is clicked. * * @return the new onclick value */ public String getOnclick() { if (_onclick != null) { return _onclick; } ValueExpression expression = getValueExpression("onclick"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
protected void renderForCommandLink(FacesContext context, HtmlForm htmlForm, ResponseWriter writer) throws IOException { final Map hiddenParameters = getCommandLinkHiddenParameters(htmlForm); boolean hasCommandLink = false; for (final Iterator it = hiddenParameters.entrySet().iterator(); it .hasNext();) { hasCommandLink = true; final Map.Entry entry = (Entry) it.next(); final String name = (String) entry.getKey(); final Object value = entry.getValue(); RendererUtil.renderHidden(htmlForm, writer, name, value); } if (hasCommandLink) { final String target = htmlForm.getTarget(); renderClearHiddenCommandFormParamsFunction(writer, getIdForRender( context, htmlForm), hiddenParameters.entrySet(), target); } htmlForm.getAttributes().remove(HIDDEN_PARAMETER_KEY); }
if (component instanceof HtmlForm) target = ((HtmlForm)component).getTarget();
/** * <p>Return the value of the <code>dir</code> property.</p> * @return the property value * <p>Contents: Direction indication for text that does not inherit directionality. * Valid values are "LTR" (left-to-right) and "RTL" (right-to-left). * These attributes are case sensitive when rendering to XHTML, so * care must be taken to have the correct case. */ public java.lang.String getDir() { return (java.lang.String) getStateHelper().eval(PropertyKeys.dir); }
/** * Construct an instance of the HtmlForm. */ public HtmlForm() { setRendererType("javax.faces.Form"); }
} else { HtmlForm htmlFormTmp; htmlFormTmp = new HtmlForm(); htmlFormTmp.setId(this.getId() + "_form"); htmlFormTmp.setStyleClass(jsfContext.resolveStyleClass(JsfStyleClasses.TABLE_FORM)); parentId = htmlFormTmp.getClientId(context); htmlForm = htmlFormTmp;
protected void encodeHtmlFormBegin(FacesContext context, HtmlForm htmlForm) throws IOException { final ResponseWriter writer = context.getResponseWriter(); writer.startElement(JsfConstants.FORM_ELEM, htmlForm); RendererUtil.renderIdAttributeIfNecessary(writer, htmlForm, getIdForRender(context, htmlForm)); RendererUtil.renderAttribute(writer, JsfConstants.NAME_ATTR, htmlForm .getClientId(context)); RendererUtil.renderAttribute(writer, JsfConstants.METHOD_ATTR, JsfConstants.POST_VALUE); renderRemainAttributes(htmlForm, writer, ignoreComponent); // action attribute final ViewHandler viewHandler = FacesContextUtil .getViewHandler(context); final String viewId = context.getViewRoot().getViewId(); final String url = viewHandler.getActionURL(context, viewId); if (url != null) { UrlBuilder urlBuilder = new UrlBuilder(); urlBuilder.setBase(url); final String encoding = writer.getCharacterEncoding(); if (WindowIdUtil.isNewWindowTarget(htmlForm.getTarget())) { urlBuilder.add(URLEncoder.encode(WindowIdUtil.NEWWINDOW, encoding), URLEncoder.encode(JsfConstants.TRUE, encoding)); } writer.writeURIAttribute(JsfConstants.ACTION_ATTR, context .getExternalContext().encodeActionURL(urlBuilder.build()), null); } }
comp.setValueBinding("accept", vb); comp.getAttributes().put("accept", _accept); comp.setValueBinding("acceptcharset", vb); comp.getAttributes().put("acceptcharset", _acceptcharset); comp.setValueBinding("enctype", vb); comp.getAttributes().put("enctype", _enctype); comp.setValueBinding("onreset", vb); comp.getAttributes().put("onreset", _onreset); comp.setValueBinding("onsubmit", vb); comp.getAttributes().put("onsubmit", _onsubmit); comp.setValueBinding("target", vb); comp.getAttributes().put("target", _target); comp.setValueBinding("style", vb); comp.getAttributes().put("style", _style); comp.setValueBinding("styleClass", vb);
HtmlForm propSetForm = new HtmlForm(); modalPanel.getChildren().add(propSetForm); String propSetFormId = ConfigurationSetComponent.getPropSetFormId(configurationSetComponent); propSetForm.setId(propSetFormId); propSetForm.setOnsubmit("prepareInputsForSubmission(this)"); propSetForm.getChildren().add(ajaxRegion); HtmlAjaxOutputPanel ajaxOutputPanel = FacesComponentUtility.createComponent(HtmlAjaxOutputPanel.class); ajaxRegion.getChildren().add(ajaxOutputPanel);
htmlForm = tmpHtmlForm; } else { final HtmlForm tmpHtmlForm = new HtmlForm(); tmpHtmlForm.setId(this.getId() + "_form"); tmpHtmlForm.setStyleClass(resolver.resolve(JsfStyleClasses.FORM)); htmlForm = tmpHtmlForm;
comp.setValueExpression("accept", _accept); comp.setValueExpression("acceptcharset", _acceptcharset); comp.setValueExpression("enctype", _enctype); comp.setValueExpression("onreset", _onreset); comp.setValueExpression("onsubmit", _onsubmit); comp.setValueExpression("target", _target); comp.setValueExpression("onclick", _onclick); comp.setValueExpression("ondblclick", _ondblclick); comp.setValueExpression("onkeydown", _onkeydown); comp.setValueExpression("onkeypress", _onkeypress); comp.setValueExpression("onkeyup", _onkeyup); comp.setValueExpression("onmousedown", _onmousedown); comp.setValueExpression("onmousemove", _onmousemove); comp.setValueExpression("onmouseout", _onmouseout); comp.setValueExpression("onmouseover", _onmouseover);
public String getClientId(FacesContext context) { String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context); if (clientId == null) { clientId = super.getClientId(context); } return clientId; }
private void handleAttribute(String name, Object value) { List<String> setAttributes = (List<String>) this.getAttributes().get("javax.faces.component.UIComponentBase.attributesThatAreSet"); if (setAttributes == null) { String cname = this.getClass().getName(); if (cname != null && cname.startsWith(OPTIMIZED_PACKAGE)) { setAttributes = new ArrayList<String>(6); this.getAttributes().put("javax.faces.component.UIComponentBase.attributesThatAreSet", setAttributes); } } if (setAttributes != null) { if (value == null) { ValueExpression ve = getValueExpression(name); if (ve == null) { setAttributes.remove(name); } } else if (!setAttributes.contains(name)) { setAttributes.add(name); } } }
/** * Gets Script to be invoked when the pointing device is moved into this element. * * @return the new onmouseover value */ public String getOnmouseover() { if (_onmouseover != null) { return _onmouseover; } ValueExpression expression = getValueExpression("onmouseover"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
if (component instanceof HtmlForm) target = ((HtmlForm)component).getTarget();
/** * <p>Set the value of the <code>enctype</code> property.</p> * @param enctype the new property value */ public void setEnctype(java.lang.String enctype) { getStateHelper().put(PropertyKeys.enctype, enctype); }