This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSF and the fly likes how to skip validation phase only Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "how to skip validation phase only" Watch "how to skip validation phase only" New topic
Author

how to skip validation phase only

scientia india
Greenhorn

Joined: Jul 02, 2009
Posts: 8
Hi

My functionality is user creation. The fields are user name and role.
I have an input text box to enter role name and a command button to search roles using the role name. My form has another input text box to enter user name and it is a required field while creating user. But whenever I am trying to search role I am forced to enter username as it is a required field.

My code is

I want to skip the required validation. Whenever I am using immediate=”true” for the search button. The user role search criterion that is role name is not able to apply.

Please help me

Thank in Advance
Athira
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

Validation is part of the basic contract of JSF. It doesn't ever want you to be capable of setting the backing bean to a corrupt state (mixed updates).

However, I do this stuff all the time using the "rendered" attribute and a pair of controls. I only render the inputText control when input is required. Otherwise I display it by rendering an outputText control (assuming I want it displayed).


Customer surveys are for companies who didn't pay proper attention to begin with.
 
jQuery in Action, 2nd edition
 
subject: how to skip validation phase only