• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FacesMessages and valueChangeListener with immediate="true"

 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JSF page that posts to a request scoped bean. Within this JSF page there is a dropdown with a valueChangeListener and immediate="true" to submit the form (without validation) and change the values of a second dropdown below the first one.

My problem arises during the following scenario:

1) User submits form to request scoped bean with some fields not filled out. FacesMessages are added and the page is redisplayed showing the errors to the user that they forgot to fill out some fields.

2) Along with filling out the required fields they had missed, user decides to change dropdown box value which fires the valueChangeListener. The valueChangeListener redisplays the page except this time the error messages that were at the top of the page are gone. This is not a good user experience.

Any suggestions on how to deal with validation messages (FacesMessages) when you've also got a valueChangeListener and immediate="true"?

Thanks
 
If you look closely at this tiny ad, you will see five bicycles and a naked woman:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic