Package javax.faces.component.html

Examples of javax.faces.component.html.HtmlInputSecret


                    }
                }
            }
            else if(uiComponent instanceof HtmlInputSecret)
            {
                HtmlInputSecret htmlInputSecret = (HtmlInputSecret)uiComponent;

                if (this.forceComponentInitialization)
                {
                    htmlInputSecret.setMaxlength((Integer)maxLength);
                }
                else
                {
                    Integer initialMaxLength = (Integer)
                        htmlInputSecret.getAttributes().get(INITIAL_MARKUP_META_DATA_KEY);

                    if (initialMaxLength == null)
                    {
                        initialMaxLength = htmlInputSecret.getMaxlength(); //value overriden by the component
                        htmlInputSecret.getAttributes().put(INITIAL_MARKUP_META_DATA_KEY, initialMaxLength);
                    }

                    // only override maxlength if not already set by xhtml definition
                    if (initialMaxLength <= 0)
                    {
                        htmlInputSecret.setMaxlength((Integer) maxLength);
                    }
                }
            }
        }
    }
View Full Code Here


    public void setUp() throws Exception
    {
        super.setUp();

        inputText = new HtmlInputSecret();

        writer = new MockResponseWriter(new StringWriter(), null, null);
        facesContext.setResponseWriter(writer);

        facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
View Full Code Here


    @Override
    protected UIComponent createComponentToTest()
    {
        return new HtmlInputSecret();
    }
View Full Code Here

        inputText.setAutocomplete("off");
        return inputText;
    }

    private static UIInput createInputForPasswordProperty() {
        HtmlInputSecret inputSecret = FacesComponentUtility.createComponent(HtmlInputSecret.class, null);
        inputSecret.setStyleClass(CssStyleClasses.PROPERTY_VALUE_INPUT);
        inputSecret.setMaxlength(PropertySimple.MAX_VALUE_LENGTH);

        // TODO: Remove the below line, as it's not secure, and improve support for displaying/validating password fields.
        inputSecret.setRedisplay(true);

        // Disable browser auto-completion.
        inputSecret.setAutocomplete("off");
        return inputSecret;
    }
View Full Code Here

{
  if (!(component instanceof HtmlInputSecret))
  {
    throw new IllegalArgumentException("Component " + component.getClass().getName() + " is no HtmlInputSecret");
  }
  HtmlInputSecret comp = (HtmlInputSecret)component;

  super.setProperties(component);

  if (_ondblclick != null)
  {
    comp.setValueExpression("ondblclick", _ondblclick);
  }
  if (_onkeydown != null)
  {
    comp.setValueExpression("onkeydown", _onkeydown);
  }
  if (_onselect != null)
  {
    comp.setValueExpression("onselect", _onselect);
  }
  if (_style != null)
  {
    comp.setValueExpression("style", _style);
  }
  if (_title != null)
  {
    comp.setValueExpression("title", _title);
  }
  if (_tabindex != null)
  {
    comp.setValueExpression("tabindex", _tabindex);
  }
  if (_onmouseover != null)
  {
    comp.setValueExpression("onmouseover", _onmouseover);
  }
  if (_onmouseout != null)
  {
    comp.setValueExpression("onmouseout", _onmouseout);
  }
  if (_onkeyup != null)
  {
    comp.setValueExpression("onkeyup", _onkeyup);
  }
  if (_requiredMessage != null)
  {
    comp.setValueExpression("requiredMessage", _requiredMessage);
  }
  if (_immediate != null)
  {
    comp.setValueExpression("immediate", _immediate);
  }
  if (_alt != null)
  {
    comp.setValueExpression("alt", _alt);
  }
  if (_maxlength != null)
  {
    comp.setValueExpression("maxlength", _maxlength);
  }
  if (_dir != null)
  {
    comp.setValueExpression("dir", _dir);
  }
  if (_onkeypress != null)
  {
    comp.setValueExpression("onkeypress", _onkeypress);
  }
  if (_onclick != null)
  {
    comp.setValueExpression("onclick", _onclick);
  }
  if (_validator != null)
  {
    comp.addValidator(new MethodExpressionValidator(_validator));
  }
  if (_size != null)
  {
    comp.setValueExpression("size", _size);
  }
  if (_onmousedown != null)
  {
    comp.setValueExpression("onmousedown", _onmousedown);
  }
  if (_disabled != null)
  {
    comp.setValueExpression("disabled", _disabled);
  }
  if (_autocomplete != null)
  {
    comp.setValueExpression("autocomplete", _autocomplete);
  }
  if (_styleClass != null)
  {
    comp.setValueExpression("styleClass", _styleClass);
  }
  if (_onchange != null)
  {
    comp.setValueExpression("onchange", _onchange);
  }
  if (_converter != null)
  {
    if (!_converter.isLiteralText())
    {
      comp.setValueExpression("converter", _converter);
    }
    else
    {
      String s = _converter.getExpressionString();
      if (s != null)
      {
        Converter converter = getFacesContext().getApplication().
          createConverter(s);
        comp.setConverter(converter);
      }
    }
  }
  if (_lang != null)
  {
    comp.setValueExpression("lang", _lang);
  }
  if (_accesskey != null)
  {
    comp.setValueExpression("accesskey", _accesskey);
  }
  if (_redisplay != null)
  {
    comp.setValueExpression("redisplay", _redisplay);
  }
  if (_onblur != null)
  {
    comp.setValueExpression("onblur", _onblur);
  }
  if (_valueChangeListener != null)
  {
    comp.addValueChangeListener(new MethodExpressionValueChangeListener(_valueChangeListener));
  }
  if (_converterMessage != null)
  {
    comp.setValueExpression("converterMessage", _converterMessage);
  }
  if (_required != null)
  {
    comp.setValueExpression("required", _required);
  }
  if (_label != null)
  {
    comp.setValueExpression("label", _label);
  }
  if (_onmouseup != null)
  {
    comp.setValueExpression("onmouseup", _onmouseup);
  }
  if (_onmousemove != null)
  {
    comp.setValueExpression("onmousemove", _onmousemove);
  }
  if (_validatorMessage != null)
  {
    comp.setValueExpression("validatorMessage", _validatorMessage);
  }
  if (_readonly != null)
  {
    comp.setValueExpression("readonly", _readonly);
  }
  if (_onfocus != null)
  {
    comp.setValueExpression("onfocus", _onfocus);
  }
  if (_value != null)
  {
    comp.setValueExpression("value", _value);
  }
}
View Full Code Here

    public void setUp() throws Exception
    {
        super.setUp();

        inputText = new HtmlInputSecret();

        writer = new MockResponseWriter(new StringWriter(), null, null);
        facesContext.setResponseWriter(writer);

        facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
View Full Code Here

{
  if (!(component instanceof HtmlInputSecret))
  {
    throw new IllegalArgumentException("Component " + component.getClass().getName() + " is no HtmlInputSecret");
  }
  HtmlInputSecret comp = (HtmlInputSecret)component;

  super.setProperties(component);

  if (_onkeypress != null)
  {
    comp.setValueExpression("onkeypress", _onkeypress);
  }
  if (_title != null)
  {
    comp.setValueExpression("title", _title);
  }
  if (_onfocus != null)
  {
    comp.setValueExpression("onfocus", _onfocus);
  }
  if (_onselect != null)
  {
    comp.setValueExpression("onselect", _onselect);
  }
  if (_valueChangeListener != null)
  {
    comp.addValueChangeListener(new MethodExpressionValueChangeListener(_valueChangeListener));
  }
  if (_size != null)
  {
    comp.setValueExpression("size", _size);
  }
  if (_required != null)
  {
    comp.setValueExpression("required", _required);
  }
  if (_lang != null)
  {
    comp.setValueExpression("lang", _lang);
  }
  if (_onclick != null)
  {
    comp.setValueExpression("onclick", _onclick);
  }
  if (_requiredMessage != null)
  {
    comp.setValueExpression("requiredMessage", _requiredMessage);
  }
  if (_onblur != null)
  {
    comp.setValueExpression("onblur", _onblur);
  }
  if (_disabled != null)
  {
    comp.setValueExpression("disabled", _disabled);
  }
  if (_onmousemove != null)
  {
    comp.setValueExpression("onmousemove", _onmousemove);
  }
  if (_accesskey != null)
  {
    comp.setValueExpression("accesskey", _accesskey);
  }
  if (_onkeyup != null)
  {
    comp.setValueExpression("onkeyup", _onkeyup);
  }
  if (_readonly != null)
  {
    comp.setValueExpression("readonly", _readonly);
  }
  if (_maxlength != null)
  {
    comp.setValueExpression("maxlength", _maxlength);
  }
  if (_onmouseout != null)
  {
    comp.setValueExpression("onmouseout", _onmouseout);
  }
  if (_converter != null)
  {
    if (!_converter.isLiteralText())
    {
      comp.setValueExpression("converter", _converter);
    }
    else
    {
      String s = _converter.getExpressionString();
      if (s != null)
      {
        Converter converter = getFacesContext().getApplication().
          createConverter(s);
        comp.setConverter(converter);
      }
    }
  }
  if (_onmousedown != null)
  {
    comp.setValueExpression("onmousedown", _onmousedown);
  }
  if (_immediate != null)
  {
    comp.setValueExpression("immediate", _immediate);
  }
  if (_onkeydown != null)
  {
    comp.setValueExpression("onkeydown", _onkeydown);
  }
  if (_converterMessage != null)
  {
    comp.setValueExpression("converterMessage", _converterMessage);
  }
  if (_autocomplete != null)
  {
    comp.setValueExpression("autocomplete", _autocomplete);
  }
  if (_validator != null)
  {
    comp.addValidator(new MethodExpressionValidator(_validator));
  }
  if (_onmouseup != null)
  {
    comp.setValueExpression("onmouseup", _onmouseup);
  }
  if (_value != null)
  {
    comp.setValueExpression("value", _value);
  }
  if (_styleClass != null)
  {
    comp.setValueExpression("styleClass", _styleClass);
  }
  if (_tabindex != null)
  {
    comp.setValueExpression("tabindex", _tabindex);
  }
  if (_label != null)
  {
    comp.setValueExpression("label", _label);
  }
  if (_ondblclick != null)
  {
    comp.setValueExpression("ondblclick", _ondblclick);
  }
  if (_dir != null)
  {
    comp.setValueExpression("dir", _dir);
  }
  if (_style != null)
  {
    comp.setValueExpression("style", _style);
  }
  if (_alt != null)
  {
    comp.setValueExpression("alt", _alt);
  }
  if (_redisplay != null)
  {
    comp.setValueExpression("redisplay", _redisplay);
  }
  if (_onchange != null)
  {
    comp.setValueExpression("onchange", _onchange);
  }
  if (_onmouseover != null)
  {
    comp.setValueExpression("onmouseover", _onmouseover);
  }
  if (_validatorMessage != null)
  {
    comp.setValueExpression("validatorMessage", _validatorMessage);
  }
}
View Full Code Here

{
  if (!(component instanceof HtmlInputSecret))
  {
    throw new IllegalArgumentException("Component " + component.getClass().getName() + " is no HtmlInputSecret");
  }
  HtmlInputSecret comp = (HtmlInputSecret)component;

  super.setProperties(component);

  if (_styleClass != null)
  {
    comp.setValueExpression("styleClass", _styleClass);
  }
  if (_immediate != null)
  {
    comp.setValueExpression("immediate", _immediate);
  }
  if (_onclick != null)
  {
    comp.setValueExpression("onclick", _onclick);
  }
  if (_alt != null)
  {
    comp.setValueExpression("alt", _alt);
  }
  if (_title != null)
  {
    comp.setValueExpression("title", _title);
  }
  if (_value != null)
  {
    comp.setValueExpression("value", _value);
  }
  if (_onmouseout != null)
  {
    comp.setValueExpression("onmouseout", _onmouseout);
  }
  if (_onselect != null)
  {
    comp.setValueExpression("onselect", _onselect);
  }
  if (_tabindex != null)
  {
    comp.setValueExpression("tabindex", _tabindex);
  }
  if (_ondblclick != null)
  {
    comp.setValueExpression("ondblclick", _ondblclick);
  }
  if (_onmouseup != null)
  {
    comp.setValueExpression("onmouseup", _onmouseup);
  }
  if (_maxlength != null)
  {
    comp.setValueExpression("maxlength", _maxlength);
  }
  if (_onmousemove != null)
  {
    comp.setValueExpression("onmousemove", _onmousemove);
  }
  if (_validatorMessage != null)
  {
    comp.setValueExpression("validatorMessage", _validatorMessage);
  }
  if (_converterMessage != null)
  {
    comp.setValueExpression("converterMessage", _converterMessage);
  }
  if (_converter != null)
  {
    if (!_converter.isLiteralText())
    {
      comp.setValueExpression("converter", _converter);
    }
    else
    {
      String s = _converter.getExpressionString();
      if (s != null)
      {
        Converter converter = getFacesContext().getApplication().
          createConverter(s);
        comp.setConverter(converter);
      }
    }
  }
  if (_required != null)
  {
    comp.setValueExpression("required", _required);
  }
  if (_onchange != null)
  {
    comp.setValueExpression("onchange", _onchange);
  }
  if (_label != null)
  {
    comp.setValueExpression("label", _label);
  }
  if (_onfocus != null)
  {
    comp.setValueExpression("onfocus", _onfocus);
  }
  if (_onmouseover != null)
  {
    comp.setValueExpression("onmouseover", _onmouseover);
  }
  if (_dir != null)
  {
    comp.setValueExpression("dir", _dir);
  }
  if (_readonly != null)
  {
    comp.setValueExpression("readonly", _readonly);
  }
  if (_lang != null)
  {
    comp.setValueExpression("lang", _lang);
  }
  if (_validator != null)
  {
    comp.addValidator(new MethodExpressionValidator(_validator));
  }
  if (_requiredMessage != null)
  {
    comp.setValueExpression("requiredMessage", _requiredMessage);
  }
  if (_autocomplete != null)
  {
    comp.setValueExpression("autocomplete", _autocomplete);
  }
  if (_size != null)
  {
    comp.setValueExpression("size", _size);
  }
  if (_accesskey != null)
  {
    comp.setValueExpression("accesskey", _accesskey);
  }
  if (_onmousedown != null)
  {
    comp.setValueExpression("onmousedown", _onmousedown);
  }
  if (_valueChangeListener != null)
  {
    comp.addValueChangeListener(new MethodExpressionValueChangeListener(_valueChangeListener));
  }
  if (_redisplay != null)
  {
    comp.setValueExpression("redisplay", _redisplay);
  }
  if (_style != null)
  {
    comp.setValueExpression("style", _style);
  }
  if (_onkeyup != null)
  {
    comp.setValueExpression("onkeyup", _onkeyup);
  }
  if (_onkeydown != null)
  {
    comp.setValueExpression("onkeydown", _onkeydown);
  }
  if (_onblur != null)
  {
    comp.setValueExpression("onblur", _onblur);
  }
  if (_onkeypress != null)
  {
    comp.setValueExpression("onkeypress", _onkeypress);
  }
  if (_disabled != null)
  {
    comp.setValueExpression("disabled", _disabled);
  }
}
View Full Code Here


    @Override
    protected UIComponent createComponentToTest()
    {
        return new HtmlInputSecret();
    }
View Full Code Here

    public void setUp() throws Exception
    {
        super.setUp();

        inputText = new HtmlInputSecret();

        writer = new MockResponseWriter(new StringWriter(), null, null);
        facesContext.setResponseWriter(writer);

        facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
View Full Code Here

TOP

Related Classes of javax.faces.component.html.HtmlInputSecret

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.