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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:22:03+00:00 2026-05-20T16:22:03+00:00

I have a scenario and dont have a clear idea for this to work

  • 0

I have a scenario and dont have a clear idea for this to work yet.

Here’s the example scenario :

  1. I have a myView.xhtml file that can be displayed as a window popup or a primefaces dialog popup from 2 other container xhtml, let’s say container1.xhtml and container2.xhtml (the myView.xhtml is included with something like this ? <ui:include src="myView.xhtml" />)
  2. And, we also have the view-scoped beans, let’s call them myViewBean, container1Bean and container2Bean
  3. container1Bean has the property of transactionDate, and container2Bean has a property of transDate
  4. myViewBean‘s @PostConstruct method will query the database based on a parameter of type date.
  5. On container1.xhtml, if a user clicks on a button that will popup the myView.xhtml, container1Bean should be able to provide it’s transactionDate to the myViewBean, and myViewBean will be able to query based on it in the @PostConstruct method.
  6. On container2.xhtml, if a user clicks on a button that will popup the myView.xhtml, container2Bean should be able to provide it’s transDate to the myViewBean, and myViewBean will be able to query based on it in the @PostConstruct method.

I was thinking about using @Inject Container1Bean and @Inject Container2Bean in the MyViewBean, so that inside MyViewBean, i can get the transactionDate of container1Bean or transDate of container2Bean. To decide which container bean is active is to check which one is not null.

But what if the container beans grows, there could be other container beans that make use of the MyViewBean, and the @Inject ContainerXXBean will grow in numbers inside the MyViewBean. There must be other solutions for this.

Please share ideas on how to accomplish this .. Thank you ! 🙂

Thank you !

  • 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-20T16:22:04+00:00Added an answer on May 20, 2026 at 4:22 pm

    If container1Bean, myViewBean and container2Bean share some properties, why not putting them in a new bean ? (let’s call it sharedBean, but I’m sure you’ll find a better name adapted to your case). You could then inject sharedBean using @ManagedProperty in every dependent bean. Let’s just try not to have circular references.

    I’ll also suggest to review your architecture. Are you sure you need all thoses beans, partitionned exactly like this? This sounds like something which will be difficult to maintain.

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

Sidebar

Related Questions

I have a path defined: when /the admin home\s?page/ /admin/ I have scenario that
I have a scenario that my load balancer translates port 80 from outside into
I have a scenario in which I'm serving a file from codebehind. which file,
I have a scenario like this: form = MockRepository.GenerateMock<IAddAddressForm>(); mediator = new AddAddressMediator(form); The
I have the following scenario that may warrant storing data in a conroller member
Scenario : i have a database table that is being updated frequently by some
I don't have a specific scenario in mind, but this question just crossed my
I have the following scenario: a Bitmap that is used as background and another
I have a problem with Core Data. The problem happens with this scenario :
I have a live web application that is failing in one specific scenario, and

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.