You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

components-passwordfield.asciidoc 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---
  2. title: PasswordField
  3. order: 11
  4. layout: page
  5. ---
  6. [[components.passwordfield]]
  7. = PasswordField
  8. ifdef::web[]
  9. [.sampler]
  10. image:{live-demo-image}[alt="Live Demo", link="http://demo.vaadin.com/sampler/#ui/data-input/text-input/password-field"]
  11. endif::web[]
  12. The [classname]#PasswordField# is a variant of [classname]#TextField# that hides
  13. the typed input from visual inspection.
  14. [source, java]
  15. ----
  16. PasswordField tf = new PasswordField("Keep it secret");
  17. ----
  18. The result is shown in <<figure.components.passwordfield.basic>>.
  19. [[figure.components.passwordfield.basic]]
  20. .[classname]#PasswordField#
  21. image::img/passwordfield-basic.png[width=40%, scaledwidth=50%]
  22. You should note that the [classname]#PasswordField# hides the input only from
  23. "over the shoulder" visual observation. Unless the server connection is
  24. encrypted with a secure connection, such as HTTPS, the input is transmitted in
  25. clear text and may be intercepted by anyone with low-level access to the
  26. network. Also phishing attacks that intercept the input in the browser may be
  27. possible by exploiting JavaScript execution security holes in the browser.
  28. [[components.passwordfield.css]]
  29. == CSS Style Rules
  30. [source, css]
  31. ----
  32. .v-textfield { }
  33. ----
  34. The [classname]#PasswordField# does not have its own CSS style name but uses the
  35. same [literal]#++v-textfield++# style as the regular [classname]#TextField#. See
  36. <<dummy/../../../framework/components/components-textfield#components.textfield.css,"CSS Style Rules">> for information on styling it.