1
votes

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.

1
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
no errors "all validations are skipped" action method is called directly - baba.kabira
//the code structure is as follows <h:panelGrid columns="2"> Type: <h:selectOneMenu label="" valueChangeListener="" id="" value="" required="true" onchange="submit()"> <f:selectItems value="" /> </h:selectOneMenu> </h:panelGrid> <ui:include src=""> <ui:param name="controller" value="" /> </ui:include> //the included code has <h:panelGrid columns="2" rendered=""> .....required="true" components.......... </h:panelGrid> - baba.kabira
devgrok.blogspot.com/2009/06/… this has to do something to my problem ?????? - baba.kabira
This is indeed related, but this treats JSF 1.x which doesn't have view scope yet. - BalusC

1 Answers

0
votes

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: