Freak
Freak

Reputation: 6873

Clear h:inputText and h:selectOneMenu value on page refresh

I have a Facelets page with two <h:inputText> text fields and one <h:selectOneMenu> dropdown field. When I refresh my page, then the values that are entered in text fields should be cleared and dropdown should be reset to its default selection. This is not happening. How is this caused and how can I solve it?

Upvotes: 2

Views: 1721

Answers (1)

BalusC
BalusC

Reputation: 1108642

Modern webbrowsers will autocomplete input fields by default or by configuration. If you'd like to prevent this browser specific behaviour, then you need to add autocomplete="off" to the individual input fields.

<h:inputText ... autocomplete="off" />
<h:inputText ... autocomplete="off" />
<h:selectOneMenu ... autocomplete="off" />

See also:

Upvotes: 1

Related Questions