views:

126

answers:

1

Hi, all

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.

A: 

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:

BalusC
thanks balusc, indeed it was in request scope. just to add to it your blog is savior for many jsf developers ;)
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
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/