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

  • Home
  • SEARCH
  • 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 7891645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:40:16+00:00 2026-06-03T06:40:16+00:00

I have RequestScoped bean because I’m redirecting the user from dataTable with records to

  • 0

I have RequestScoped bean because I’m redirecting the user from dataTable with records to edit page. In this dataTable I have delete buttons:

<p:column>
    <p:commandButton update=":deleteNewsDialog" oncomplete="deleteNewsDlg.show()" icon="ui-icon-closethick">
        <f:setPropertyActionListener value="#{news}" target="#{newsBean.news}" />
    </p:commandButton>
</p:column>

And here is the dialog:

<p:confirmDialog id="deleteNewsDialog" message="Czy na pewno chcesz usunąć wiadomość o tytule &quot;#{newsBean.news.title}&quot;?"
    header="Usuwanie wiadomości" severity="alert"
    widgetVar="deleteNewsDlg" appendToBody="true">
    <h:form>
        <p:commandButton value="Usuń" actionListener="#{newsBean.delete}" update=":newsesTableForm:newsesTable, :newsesTableForm:newsGrowl"/>
        <p:commandButton value="Anuluj" oncomplete="deleteNewsDlg.hide();"/>
    </h:form>
</p:confirmDialog>

When newsBean.delete is fired, newsBean not longer exists so I get a lot of ugly validation exceptions. I have other pages like this with ViewScoped beans and there it is working like a charm. Help?

  • 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-03T06:40:18+00:00Added an answer on June 3, 2026 at 6:40 am

    A request scoped bean has a lifetime of exactly one HTTP request/response. So retrieving the entire view with the form is already one HTTP request/response. The request scoped bean is trashed by end of the response. When you fire an ajax request on the view, then you’re essentially sending a new HTTP request. This will thus create a new request scoped bean which get trashed by end of HTTP response. So every ajax request on the same view get its own request scoped bean instance.

    This is not what you want if you need to maintain data related to the view. You need to put the bean in the view scope instead. The bean will live as long as you’re interacting with the same view by ajax and return null or void in action listener methods. Note that when you return a String, even if empty, the view will be recreated and thus the view scoped bean will be trashed.

    See also:

    • How to choose the right bean scope?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two drop downs on a page whose backing bean is Request Scoped.
I have a custom converter which is this : @ManagedBean @RequestScoped public class MeasureConverter
I have a login mechanism consisting of a JSF page + managed bean +
In my application, I have an @ApplicationScoped CDI bean to store some information from
I have already one session scoped CDI bean, which keeps currently logged in user
I have a page start.jsf which points to an action #{ruler.start}, this action forwards
I have a @RequestScoped CDI bean that I want to turn into an EJB
I have a CDI bean annotated with @Named and @RequestScoped. It is working perfectly
Have a look at this picture alt text http://www.abbeylegal.com/downloads/2009-04-01/web%20part%20top%20line.jpg Does anyone know what css
Have someone tried out DeCAL in Delphi 2009? I'm thinking about upgrading from 2007,

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.