1

I have couple of panel grids with rendered attribute, on value change event of a drop down list, I make one of the panel grids visible, this works fine. But after the panel is displayed all the conversions and validations attached to components inside panel grid fail.

Even if the component is single and outside the grid it fails validation.

Am I missing something on rendered attribute? Is there some thing going on in JSF lifecycle.

Any help will be really helpful...

Thanks in advance

I am using jsf 2.0 mojarra implentation.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
baba.kabira
  • 3,111
  • 2
  • 26
  • 37
  • I don't understand what you mean with "all validations fail". What errors did you got then? Or do you *actually* mean "all validations are not executed"? I.e. the validation is completely skipped. – BalusC Sep 25 '10 at 17:25
  • no errors "all validations are skipped" action method is called directly – baba.kabira Sep 25 '10 at 17:51
  • //the code structure is as follows Type: //the included code has .....required="true" components.......... – baba.kabira Sep 25 '10 at 18:02
  • http://devgrok.blogspot.com/2009/06/commandbutton-not-calling-action-when.html this has to do something to my problem ?????? – baba.kabira Sep 25 '10 at 18:56
  • This is indeed related, but this treats JSF 1.x which doesn't have `view` scope yet. – BalusC Sep 25 '10 at 19:05

1 Answers1

0

You need to ensure that the condition responsible for the rendered attribute evaluates the same in the subsequent request. JSF will namely recheck the condition during apply request values and validations phases. As of now it look like that your bean is request scoped and that the condition got lost in the subsequent request. Easiest fix is to place the bean in view scope by annotating it as @ViewScoped. This way the bean will live as long as you're interacting with the same view.

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • thanks balusc, indeed it was in request scope. just to add to it your blog is savior for many jsf developers ;) – baba.kabira Sep 26 '10 at 05:48
  • Cheers, you're welcome. Don't forget to mark the answer accepted if it helped in solving the problem. See also http://stackoverflow.com/faq :) – BalusC Sep 26 '10 at 05:50
  • using jsf 2 + spring 3, this link helped with view scope http://cagataycivici.wordpress.com/2010/02/17/port-jsf-2-0s-viewscope-to-spring-3-0/ – baba.kabira Sep 26 '10 at 06:57