users@javaserverfaces.java.net

Re: A question about using the same JSP file to add and update data.

From: Roger Kitain <Roger.Kitain_at_Sun.COM>
Date: Wed, 10 Jan 2007 12:01:09 -0500

Hello Todd -

I presume you want the fields to appear blank when you are ready to update?
In your action handler for the update button, you could re-initialize
the backing bean
properties before the page is rendered again.


Todd Patrick wrote:

>JSF 1.1
>
>I have a single JSP file.
>
>What I would like to do is use the same JSP file to add *AND* update
>data in the same database table.
>
>I have all of the h:inputText elements' value attributes bind to the
>related backing bean properties. The backing bean scope is set to
>request.
>
>JSP <--> Backing Bean
>
>What is happening; the JSP page is used for adding data.
>
>When I go back to the page, through a different h:commandButton action,
>to update the data, the user's value entered in the h:inputText elements
>to add data are still present instead of the values from the backing
>bean.
>
>Is there something I need to do to clear the context or cache of these
>elements?
>
>Thanks,
>
>--Todd
>
>-----------------------------------------
>NOTICE: This email message is for the sole use of the intended
>recipient(s) and may contain confidential and privileged
>information. Any unauthorized use, disclosure or distribution is
>prohibited. If you are not the intended recipient, please contact
>the sender by reply email and destroy all copies of the original
>message.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_javaserverfaces.dev.java.net
>For additional commands, e-mail: users-help_at_javaserverfaces.dev.java.net
>
>
>