Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with valuechange listener

 
Mahendra Pratap
Ranch Hand
Posts: 42
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I am facing a problem while dealing with valuechange listener.

I have one JSF compenent and that is required field and the code is





I have listenerMethod in backing bean. first when user go to this page there is some value of country if user selects 1st option i.e. Please select Country the due to validation it is giving validation exception, and resetting the selection to the previous value.

But i want the newly selected value to be selected by default.


If i remove required="true" then the null value is getting saved.

Do i need to go for custom Validator or is there any other way to achieve this?

any help would be highly appreciated.

thanks
Mahendra
 
Mahendra Pratap
Ranch Hand
Posts: 42
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kindly ask me if i have not provided sufficient information.

Thanks,
Mahendra
 
Mahendra Pratap
Ranch Hand
Posts: 42
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could anyone of you please provide some help..?


or lets say discussion?

thanks,
Mahendra
 
Ketan Jambhekar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You need to call

in your listner method.
This will fetch the latest value for you.

Ketan.
 
Did you just should on me? You should read this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!