tags:

views:

22

answers:

1

The input field boxes are filled with #{ad.userid} like that in all pages. And even though when I enter valid values they are giving null values in managed bean when accessed in action method. How can this happen and how can I solve this?

A: 

This can be caused by unnecessarily having immediate="true" in h:commandButton, or by using rendered, disabled or readonly attributes in the input fields (or one of its parent components) which are depending on a request scoped bean which isn't properly retained in the subsequent request. There are more possible causes, but that's too much to be mentioned. The aforementioned are at least the most common causes among starters.

To learn more about the JSF lifecycle so that you can get a better understanding of what's all happening "under the hoods" so that you can nail it better down yourself, check this article: Debug JSF lifecycle

BalusC