Gave it a shot.  That is pretty nice.  I was actually able to set the entire user object in my ModifyUserBean vs individual properties of that object as the wiki has for it's example.  Not too shabby.

Thanks for the tip.

Gregg

On 6/9/06, Gregg Bolinger <[EMAIL PROTECTED]> wrote:
Thanks for the link.  That looks interesting.  I might try that and see if it clean up my code any.  Although, it would appear that it is doing the same thing I am doing now, but in the JSP rather than me doing it in my java code.

Thanks again.



On 6/9/06, Matthias Wessendorf < [EMAIL PROTECTED]> wrote:
Gregg,

have you tried to use the "updateActionListener" for some master/detail stuff?

It works pretty good!

http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters

-Matthias

On 6/9/06, Gregg Bolinger < [EMAIL PROTECTED]> wrote:
> What I've discovered is that if in the constructor I do setCurrentUser(new
> User()), then when the values are being repopulated on a validation errror,
> there is an object to apply those values to.
>
> 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.
> >
> >
>
>


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com


Reply via email to