Hi there,

Thank u guys for your warm help, I eventually find out the cause of this
problem.

In that page I have a drop-down box, which has a "valueChangeListener", and
bound to a property of a managed bean.

When the managed bean is created, the default value of the drop-down
property was not set(ramains null). So when the first time the user visits
this page, and clicks the submit button, the "valueChangeEvent" is fired
(old value is null, now it gets a non-null value), and the response is sent
and the page is rendered in the "valueChangeListener". So for the user it
seems nothing is done but refreshing the screen when he clicks the button.

Assigning a default value to the drop-down box solves this problem.

Lots of thanks again!

Fan


Fan Shao wrote:
> 
> Hi there,
> 
> I've written a JSF page using Facelets template. I have a form in the page
> and a button. Every time I restarted the webapp, the first time I click
> the button it just refreshes the page and resets all the input fields.
> After that the button works normally with all the fields correctly
> submitted.
> 
> This means I have to click the button once before I can do any work
> everytime the server is restarted.
> 
> Anyone has any idea about this problem?
> 

-- 
View this message in context: 
http://www.nabble.com/Button-must-be-clicked-once-before-it-could-actually-do-something-tf4297733.html#a12464541
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to