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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ---
  2. title: PasswordField
  3. order: 11
  4. layout: page
  5. ---
  6. [[components.passwordfield]]
  7. = [classname]#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. See the http://demo.vaadin.com/book-examples-vaadin7/book#component.passwordfield.basic[on-line example, window="_blank"].
  19. The result is shown in <<figure.components.passwordfield.basic>>.
  20. [[figure.components.passwordfield.basic]]
  21. .[classname]#PasswordField#
  22. image::img/passwordfield-basic.png[width=40%, scaledwidth=50%]
  23. You should note that the [classname]#PasswordField# hides the input only from
  24. "over the shoulder" visual observation. Unless the server connection is
  25. encrypted with a secure connection, such as HTTPS, the input is transmitted in
  26. clear text and may be intercepted by anyone with low-level access to the
  27. network. Also phishing attacks that intercept the input in the browser may be
  28. possible by exploiting JavaScript execution security holes in the browser.
  29. [[components.passwordfield.css]]
  30. == CSS Style Rules
  31. [source, css]
  32. ----
  33. .v-textfield { }
  34. ----
  35. The [classname]#PasswordField# does not have its own CSS style name but uses the
  36. same [literal]#++v-textfield++# style as the regular [classname]#TextField#. See
  37. <<dummy/../../../framework/components/components-textfield#components.textfield.css,"CSS Style Rules">> for information on styling it.