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 8729331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:48:54+00:00 2026-06-13T08:48:54+00:00

I need help. I’m new to JSF and im using JSF2 and richfaces in

  • 0

I need help. I’m new to JSF and im using JSF2 and richfaces in my project.

I want to clear the form for which I’m using <f:ajax render="@form"/> in refresh button. I have an ADD button on that screen which adds one record and I hit refresh then it’s going to the default page. But when I once again go to enter a record then those values which I entered earlier remain in the form fields.

Can anyone please help me out with this issue?

  • 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-06-13T08:48:55+00:00Added an answer on June 13, 2026 at 8:48 am

    Assuming that you mean the browser’s refresh button when you say "I hit refresh", then that can happen if you’ve incorrectly placed the bean holding view scoped data in the session scope. You’re then basically reusing the very same bean as the form is previously been submitted to. Putting the bean in the view scope instead of the session scope should fix this problem. The view scope ends when you navigate to a different page or fires a new request (as by hitting browser’s refresh button).

    See also:

    • How to choose the right bean scope?

    Update if you’re due to bad design restricted to using session scope, then you might want to hack this around by a

    <f:event type="preRenderView" listener="#{sessionScopedBeanWhichShouldActuallyBeViewScoped.resetModel}" />
    

    with

    public void resetModel() { 
        if (!FacesContext.getCurrentInstance().isPostback()) {
            model = null;
        }
    }
    

    This will clear the model on every GET request. However, regardless of this hack, you’ll still run into serious problems when the enduser opens the same view in a different browser tab/window within the same session.

    The right solution is to put the bean in the view scope instead of the session scope, as said earlier.

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

Sidebar

Related Questions

Need help I am scraping data from this website which has a form that
need help to read xml file. i have one xml file which i want
Need help writing a script downloads data from google insight using c# this is
need help regarding USSD Gateway. I have to develop an app, which will directly
I need help with one ajax function This is raw page setup. Page will
Need help, I am tring to make an android game as project for my
Need help with copying array object to a temp array object using a for
Need help... I have 3 classes, Manager which holds 2 pointers. One to class
Need help with implementing a pure abstract class via inheritance , using namespace to
Need help compiling in C. When using GCC at home (Windows, 3.4.5), the code

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.