Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7509253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:51:01+00:00 2026-05-29T22:51:01+00:00

I am doing a product insert form in PrimeFaces dialog. My bean’s scope is

  • 0

I am doing a product insert form in PrimeFaces dialog. My bean’s scope is session. I can insert a product, but when I try to insert another product, the form has previous product’s information. I want to reset form. I tried UIInput but it doesnt work. How can I clear the form?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:51:03+00:00Added an answer on May 29, 2026 at 10:51 pm

    Just create a new product after saving it and make sure that you’re ajax-updating the form after save.

    E.g.

    <h:form>
        <h:inputText value="#{productController.product.name}" />
        <h:inputTextarea value="#{productController.product.description}" />
        <h:selectOneMenu value="#{productController.product.category}">
            <f:selectItems value="#{applicationData.categories}" />
        </h:selectOneMenu>
        <p:commandButton value="Save" action="#{productController.save}" update="@form" />
    </h:form>
    

    with

    public void save() {
        productService.save(product);
        product = new Product();
    }
    

    By the way, that kind of bean really doesn’t belong in the session scope. Put it in the view scope.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi I am doing A query to get some product info, but there is
When doing an INSERT with a lot of data, ie: INSERT INTO table (mediumtext_field)
I am doing this in each and every DAL method: public static Product GetProductByPartNumber(String
I'm having to insert values into a new column in our database but I
I am trying to do multiple product add with a form using php and
I have to insert many product value records into an Oracle table. I get
Usually I have to insert some data in a DB and it can't be
So situation is following : We have some very old product, that has dozen
I have two Classes. Product and Product can have a number of objects of
Doing odd/even styling with jQuery is pretty easy: $(function() { $(.oddeven tbody tr:odd).addClass(odd); $(.oddeven

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.