protected void setMaxlength(UIInput input, int maxlength) { if (input instanceof HtmlInputText) { ((HtmlInputText) input).setMaxlength(maxlength); } else if (input instanceof HtmlInputSecret) { ((HtmlInputSecret) input).setMaxlength(maxlength); } else if (input instanceof InputTextarea) { ((InputTextarea) input).setMaxlength(maxlength); } }
protected int getMaxlength(UIInput input) { if (input instanceof HtmlInputText) { return ((HtmlInputText) input).getMaxlength(); } else if (input instanceof HtmlInputSecret) { return ((HtmlInputSecret) input).getMaxlength(); } return Integer.MIN_VALUE; }
@Override public Converter getConverter() { Converter converter = super.getConverter(); if (converter == null && PrimeApplicationContext.getCurrentInstance(getFacesContext()).getConfig().isClientSideValidationEnabled()) { DateTimeConverter con = new DateTimeConverter(); con.setPattern(calculatePattern()); con.setTimeZone(CalendarUtils.calculateTimeZone(this.getTimeZone())); con.setLocale(calculateLocale(getFacesContext())); return con; } return converter; } }
public static void copyHtmlInputTextAttributes(HtmlInputText src, HtmlInputText dest) { dest.setId(src.getId()); dest.setImmediate(src.isImmediate()); dest.setTransient(src.isTransient()); dest.setAccesskey(src.getAccesskey()); dest.setAlt(src.getAlt()); dest.setConverter(src.getConverter()); dest.setDir(src.getDir()); dest.setDisabled(src.isDisabled()); dest.setLang(src.getLang()); dest.setLocalValueSet(src.isLocalValueSet()); dest.setMaxlength(src.getMaxlength()); dest.setOnblur(src.getOnblur()); dest.setOnchange(src.getOnchange()); dest.setOnclick(src.getOnclick()); dest.setOndblclick(src.getOndblclick()); dest.setOnfocus(src.getOnfocus()); dest.setOnkeydown(src.getOnkeydown()); dest.setOnkeypress(src.getOnkeypress()); dest.setOnkeyup(src.getOnkeyup()); dest.setOnmousedown(src.getOnmousedown()); dest.setOnmousemove(src.getOnmousemove()); dest.setOnmouseout(src.getOnmouseout()); dest.setOnmouseover(src.getOnmouseover()); dest.setOnmouseup(src.getOnmouseup()); dest.setOnselect(src.getOnselect()); dest.setReadonly(src.isReadonly()); dest.setRendered(src.isRendered()); dest.setRequired(src.isRequired());
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); } } }
protected boolean isDisabled(FacesContext facesContext, UIComponent component) { //TODO: overwrite in extended HtmlTextRenderer and check for enabledOnUserRole if (component instanceof HtmlInputText) { return ((HtmlInputText)component).isDisabled(); } return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(component, HTML.DISABLED_ATTR, false); }
inputText.setStyle( ( (HtmlMetawidget) metawidget ).getStyle() ); inputText.setStyleClass( ( (HtmlMetawidget) metawidget ).getStyleClass() ); children.add( inputText ); inputText.setId( "suggestionText_" + FacesUtils.createUniqueId() ); suggestionBox.setId( "suggestionBox_" + FacesUtils.createUniqueId() ); suggestionBox.setFor( inputText.getId() ); suggestionBox.setVar( "_internal" ); children.add( suggestionBox );
HtmlInputText inputUser = new HtmlInputText(); inputUser.setId(USER_NAME); inputUser.setMaxlength(User.USERNAME_MAX_LENGHT); inputUser.setSize(User.USERNAME_MAX_LENGHT); panel.getChildren().add(inputUser);
public static String getEditingMode(final HtmlInputText text) { if (text.isReadonly()) { return "readonly"; } else if (text.isDisabled()) { return "disabled"; } return "editable"; }
comp.setValueBinding("maxlength", vb); comp.getAttributes().put("maxlength", Integer.valueOf(_maxlength)); comp.setValueBinding("size", vb); comp.getAttributes().put("size", Integer.valueOf(_size)); comp.setValueBinding("style", vb); comp.getAttributes().put("style", _style); comp.setValueBinding("styleClass", vb); comp.getAttributes().put("styleClass", _styleClass); comp.setValueBinding("alt", vb); comp.getAttributes().put("alt", _alt); comp.setValueBinding("tabindex", vb); comp.getAttributes().put("tabindex", _tabindex); comp.setValueBinding("onblur", vb); comp.getAttributes().put("onblur", _onblur); comp.setValueBinding("onfocus", vb);
@Override public UIInput createInput() { HtmlInputText input = new HtmlInputText(); LengthValidator validator = new LengthValidator(); if (getMaxLenght() != null) { input.setSize(getMaxLenght()); input.setMaxlength(getMaxLenght()); validator.setMaximum(getMaxLenght()); } validator.setMinimum(getMinLenght()); input.addValidator(validator); return input; }
/** * Construct an instance of the HtmlInputText. */ public HtmlInputText() { setRendererType("javax.faces.Text"); }
private static UIInput createInputForStringProperty() { HtmlInputText inputText = FacesComponentUtility.createComponent(HtmlInputText.class, null); //TODO: check if this has units, then apply the correct style inputText.setStyleClass(CssStyleClasses.PROPERTY_VALUE_INPUT); // inputText.setStyle(INPUT_TEXT_WIDTH_STYLE_WITH_UNITS); inputText.setMaxlength(PropertySimple.MAX_VALUE_LENGTH); // Disable browser auto-completion. inputText.setAutocomplete("off"); return inputText; }
values.put(key,"newValue"); HtmlInputText input = new HtmlInputText(); input.setId("id_"+key); input.setValueExpression("value", createValueExpression( "#{WSDLPanelGrid.values['"+key+"']}", new Class[0], String.class));
HtmlInputText input1 = (HtmlInputText)application.createComponent(HtmlInputText.COMPONENT_TYPE); input1.setId("input1"); input1.setValueExpression(createValueExpression("#{cRReviewReportBean.input1}", String.class));
/** {@inheritDoc} */ @Override protected UIInput createInput(final PropertyDescriptor<P, E> property, final RenderContext context) { final HtmlInputText input = new HtmlInputText(); input.setStyleClass(context.resolveStyleClass(JsfStyleClasses.FORM_INPUT_TEXT)); return input; }
inputText.setLocalValueSet(false); inputText.setStyle("display: none"); ComponentUtils.encodeComponent(context, inputText);
HtmlInputText input1 = (HtmlInputText)application.createComponent(HtmlInputText.COMPONENT_TYPE); input1.setId("input1"); //How can i set inputtext value to something //like: #{cRReviewReportBean.input1} in order to store //form data (cRReviewerFromData)?
dest.setId(src.getId()); boolean forceId = getBooleanValue(JSFAttr.FORCE_ID_ATTR, src .getAttributes().get(JSFAttr.FORCE_ID_ATTR), false); if (forceId) dest.getAttributes().put(JSFAttr.FORCE_ID_ATTR, Boolean.TRUE); dest.setImmediate(src.isImmediate()); dest.setTransient(src.isTransient()); dest.setAccesskey(src.getAccesskey()); dest.setAlt(src.getAlt()); dest.setConverter(src.getConverter()); dest.setDir(src.getDir()); dest.setDisabled(src.isDisabled()); dest.setLang(src.getLang()); dest.setLocalValueSet(src.isLocalValueSet()); dest.setMaxlength(src.getMaxlength()); dest.setOnblur(src.getOnblur()); dest.setOnchange(src.getOnchange()); dest.setOnclick(src.getOnclick()); dest.setOndblclick(src.getOndblclick()); dest.setOnfocus(src.getOnfocus()); dest.setOnkeydown(src.getOnkeydown()); dest.setOnkeypress(src.getOnkeypress()); dest.setOnkeyup(src.getOnkeyup()); dest.setOnmousedown(src.getOnmousedown()); dest.setOnmousemove(src.getOnmousemove()); dest.setOnmouseout(src.getOnmouseout()); dest.setOnmouseover(src.getOnmouseover());
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); } } }