You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Rafael Nami <ra...@gmail.com> on 2005/09/09 17:49:29 UTC
Pass a Date to a h:inputText from a backing bean(and repost it)
Hi all
I'm trying to use MyFaces to develop a CRUD application, and so far it
is working like a charm. But I have something that isn't occurring
like I was expecting. I have to do a simple auditing in my app(is
quite simple - When I add a record, in the backing bean I set the
creationDate in my edit() method, and when I update a record, I set
the updateDate in my edit() method). But the thing is that the
h:inputText of creationDate isn't receiving the actual date, neither
the h:inputText of updateDate is receiving the actual date. I've tried
a simple solution, just adding String creationDate and String
updateDate to the backing bean, setting it in the edit() method, and
in the save() method, catching and setting the date in the bean. But
this also doesn't work. How can I ass this behavior to my app?
Thx a lot
Rafael Mauricio Nami
Re: Pass a Date to a h:inputText from a backing bean(and repost it)
Posted by Mike Kienenberger <mk...@gmail.com>.
Chances are that you're using a request-scoped backing bean, but
expecting it to persist across to the next request.
You need to use x:saveState on your backing bean or you need to change
the scope of the bean to session.
Don't know if there's a wiki on this, yet, but there should be.
On 9/9/05, Rafael Nami <ra...@gmail.com> wrote:
> Hi all
>
> I'm trying to use MyFaces to develop a CRUD application, and so far it
> is working like a charm. But I have something that isn't occurring
> like I was expecting. I have to do a simple auditing in my app(is
> quite simple - When I add a record, in the backing bean I set the
> creationDate in my edit() method, and when I update a record, I set
> the updateDate in my edit() method). But the thing is that the
> h:inputText of creationDate isn't receiving the actual date, neither
> the h:inputText of updateDate is receiving the actual date. I've tried
> a simple solution, just adding String creationDate and String
> updateDate to the backing bean, setting it in the edit() method, and
> in the save() method, catching and setting the date in the bean. But
> this also doesn't work. How can I ass this behavior to my app?
>
> Thx a lot
>
> Rafael Mauricio Nami
>