I guess what is sort of confusing me is the fact that, realizing how request scope works, everytime the form is submitted a new copy of said managed bean is being created. Although I was under the impression that the request is being forwarded unless the REDIRECT tag is used in the faces-config for the bean declaration and that the managed bean would be forwared along with that request. However, would it be a true statement to say that the properties of the backing bean are persisted across the request, but that the actual backing bean object is not?
Thanks.
On 6/9/06, Gregg Bolinger <[EMAIL PROTECTED]> wrote:
I am currently trying something that I haven't seen anyone else do (doesn't mean someone else isn't doing it). In UserAdminBean I have a dataTable with a list of users. When I click on one of the users in the dataTable I am taken to ModifyUser.jsp which uses ModifyUserBean.
In the action method in UserAdminBean to go to ModifyUser, I am doing the following:
User user = (User)getUserData().getRowData();
FacesContext fc = FacesContext.getCurrentInstance ();
ModifyUserBean userBean = (ModifyUserBean) fc.getApplication().createValueBinding("#{ModifyUserBean}").getValue(fc);
userBean.setCurrentUser(user);
Now, in ModifyUser.jsp I have the following:
<h:outputLabel for=""> <h:outputText value="#{bundle.globalFirstNameLabel}"/>
</h:outputLabel>
<h:inputText id="firstName" value="#{ModifyUserBean.currentUser.firstName }" required="true"/>
When the page first comes up, the firstName field is populated appropriatly. However, when I try and submit the form, I get a conversion error on firstName. I *think* it's because when the form is being validated the currentUser object has been lost out of scope and so that phase is getting NULL back for the value of firstName. Is this accurate? If so, is there anything I can do to make this process work aside from putting things in session.
I've also tried placing a saveState on the ModifyUser form with a value of #{ManageUserForm.currentUser} but that didn't solve anything.
Thanks for any feedback.