File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Render Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Render Problem" Watch "Render Problem" New topic
Author

Render Problem

udaya krishna
Ranch Hand

Joined: Mar 19, 2009
Posts: 46

Hi ,
I have a problem regarding render in JSF. I have created two radio buttons "Enable" and "Disable" and a textbox.I have written the validation for the text box using required="true" attribute so that that textbox cannot be empty.My question is that is it possible such that validation happens only if "enable" radio button is selected? when "Disable" is selected validation should not happen.I have already used render for the input text box.so i cannot use render again for validation.Any suggestions?

Thanks
udaya krishna
Ranch Hand

Joined: Mar 19, 2009
Posts: 46

And the reason i am asking for it is that if the user enters say 0 in the textbox and then he selects "Disable" button i am still getting the validation error message(I have a validation such that the value in the textbox cannot be 0) .
Thanks
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16065
    
  21

I'm afraid that view-level validation is unconditional. Conditional validation is something that the action handler method must do. The only other way would be to create a complex custom validator, and that's rarely worth it.


Customer surveys are for companies who didn't pay proper attention to begin with.
udaya krishna
Ranch Hand

Joined: Mar 19, 2009
Posts: 46

hmm..thanks tim..i do have some custom validators written in my project.will try it..meanwhile if any other suggestions are available i would like to know
 
 
subject: Render Problem