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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:50:15+00:00 2026-05-13T14:50:15+00:00

I am trying to popup a window when someone clicks a button on the

  • 0

I am trying to popup a window when someone clicks a button on the data table.

                                    <h:commandButton
                                        action="#{cacheController.popupDetails}"
                                        immediate="false"
                                        onclick="popup()"
                                        value="View Details"
                                         styleClass="submit">
                                    </h:commandButton>

The associated popup function is

function popup() {
window.open('RDDetails.jsf','popupWindow', 'dependent=yes, menubar=no, toolbar=no, height=500, width=400');
}

Now in the new ‘RDDetails.jsf” file, I am trying to access the same managedBean cacheController. But the problem is, the pop-up window and JSF lifecycle is not in sync. As a result, the popup first displays blank and when I refresh, it pulls out the proper data.

Is there anyway I can click on a button which will do some processing in the managed bean and then opens a pop up which rerieves the processed data from the managed bean.

I am using JSF 1.1.

  • 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-13T14:50:15+00:00Added an answer on May 13, 2026 at 2:50 pm

    You’re here basically firing two independent requests: one associated with the form submit and other which opens the RDDetails.jsf in a popup. You’ll need to combine this in one request. You can achieve this in basically two ways:

    1. Get rid of the onclick and just add target="_blank" to the <h:form> so that it get submitted into a new window/tab.

    2. Block the default action by adding return false; to the onclick and do the business logic in the constructor of the bean associated with RDDetails.jsf. The only (major) caveat is here that the model won’t be updated with the form fields. Thus, you’ll need to pass the form fields as request parameters of the popup URL manually with help of JavaScript. You can then make use of managed property entries in the faces-config.xml to inject the GET request parameters into the model.

    First way is obviously the easiest, but this doesn’t give you a “fullworthy” popup/modal dialog. The second way is a bit harder (unless you’ve already a good grasp on both JavaScript and JSF). I would then consider to look for a component library which provides a ready-to-use popup component.

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

Sidebar

Related Questions

I am trying to make a Login popup window. For example, if someone clicked
I'm trying to implement popup search window in a PHP project. I included JQuery
I'm trying to implement a basic popup window that asks the user if they
I am trying to format this line of code in my popup window, but
I'm opening a popup window via javascript. I'm trying to set some of the
I'm trying to open my chat script in a popup window using window.open function.
I'm trying to post data with jQuery in an asp.net application to a popup.
I'm trying to create my own modal window (the built in popup manager won't
I'm trying to create a dynamic popup window that is able to be re-sized.
I am trying to open popup using window.open finction but somehow it's not working

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.