• Post Reply Bookmark Topic Watch Topic
  • New Topic

Typical Validation Issue - Solutions?

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing a pretty typical JSF validation issue. I have a list of commandLinks which are Categories. On the right side of the page I have a form with details about the category. You can also use this form to add or update a category.

Obviously, the category name is required. But since it is blank when the page loads, and if I click on a category link to view the details, I get a validation error. No surprise. So I change the commandLink immediate="true" and, you guessed it, my model isn't updated so most of the details don't get populated in the form.

I've tried many different suggestions that I found on various different sites. I am not interested in adding yet another dependency to this project as in a 3rd party validation library. But I would like to know what other people did to solve this similar issue, if they solved it.

Thanks.
 
Tim Holloway
Bartender
Posts: 18417
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems like what you'd want to do is disable the links that aren't yet meaningful. That's just a simple boolean test.

It's what I do, anyway.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, all the links need to be enabled. At any point on the page, the user needs to be able to click a Category link and see the details.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For now what I've done is resorted to doing manaul validation in my action methods.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!