request bean is null when ui:fragment is used to conditionally display content in facelets

394 views Asked by At

I have a page content which I display based on a condition produced by the action (f:ajax) of a button. The managed bean is in request scope.

when I do not use conditional display and allow the page to display entirely, the backing bean properties are applied with the form values. However when I use conditional display using ui:fragment , the backing bean properties are not applied with the form values and in the action method the backing bean properties are null.

Could some one suggest what might be the issue ?

1

There are 1 answers

2
Mike Braun On BEST ANSWER

My first suggestion would be to show some code. It's hard to guess what you're exactly doing.

If I do had to make a guess though, then this would be that the input fields are still conditionally excluded at the point where JSF is processing them.

As a quick test try putting the backing bean in view scope (@ViewScoped) and see if the problem persists.