简体   繁体   中英

jsf component with render attribute failing validation

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.

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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM