Popup window in JSF

Hi All,
In Java EE Application i have created two JSF pages. When i click a button in first JSF, the second JSF page should appear in a pop up window. Is that possible.
Let me also know how to add a pop up in JSF.
Regards,
Manickka.

In your case, If you really need a popup window I think that an option that will work is use a h:commandLink:
- Use the onclick method of the h:commandLink to open a blank new page, with the name for example "blankPopUp".
- Use a h:commandLink to navigate to the second page. The action method can be used to run a JSF navigation.
- Use the target method of the command link to point to your window opened via javascript in the onclick event. In this case the target will be "blankPopUp". Then your content returned by the JSF navigation will be rendered in the already opened popup window. Then you will work with two windows, it will be like two tabs in your browser, but in this sample, only one will be a tab and another will be a popup window.
Sample code:
            <h:commandLink id="openPopUp" value="OPEN POPUP" target="blankPopUp" onclick="window.open('','blankPopUp','status=no,toolbar=no,location=no,menubar=no,resizable,width=1008,height=690,scrollbars,left=100,top=50');" action="#{yourBean.navigateToSecondPage}" />Regards.
Edited by: kerule on 29-abr-2012 15:07

Similar Messages

  • Rendering popup windows in JSF form on demand

    Hello,
    i have a form with a RichFaces menu bar at the top and several other UI components , eg. commandButtons. When a <rich:menuItem> or a <a4j:commandButton> component is clicked, a hidden modal popup window appears for user interaction. At the moment, all JSF files associated with the NetBeans project are downloaded to the client machine.
    In order to reduce network traffic for low bandwidth internet connections, i would like to only download the popup window JSF files from the server to the client if the relevant form UI component is clicked.
    Would anyone suggest a possible method to achieve this please?
    Thanks,
    Mark Weatherill.

    you can open a popup page from commandButton like,
    onclick="window.open('http://www.myapp.com/faces/popup.jsp'); return false;"Use the same faces-managed-bean to input data (on popup page and on the main page). Before closing the popup page you can submit its form to update the model. And after closing the popup page you can refresh the main page. Beware that you might have problems with refreshing in https connection (getting "access is denied" exceptions in jscript)

  • Solution: Using Popup Windows in JSF Applications

    URL: http://forum.exadel.com/viewtopic.php?t=559
    This example shows:
    * how to use a client-side script to control a form field rendered by JSF
    * how to launch a popup window and return a result back to the main window
    * how to use the standard JSF Navigation Framework for navigation in a multiple-windows interface environment.

    It works only with latest ( jsf-ri beta ) version. EA4 used to require completely another approach to do the same.
    According to diagnostic message, you have problem with running jsf-ri itself, but now with this example application.
    There is a good test to examine that your environment is ready to work with jsf-ri: jsf-ri is shipped along with demo-components.war example. Try to deploy it. If it works, jsf-popup example should work also.
    Perhaps, your servlet container does not with servlet-mapping like *.jsf . I met this problem couple time when play with standard jsf-ri examples. So, you can try to replace *.jsf with /faces/* and index.jsp should contain <jsp:forward page="faces/pages/inputdata.jsp" /> in this way.
    Finally, I have received several request about working with WSAD 5.1 . It looks like 5.1 does not support jsf-ri applications at all. This is a link that explains the problem: http://forum.java.sun.com/thread.jsp?forum=427&thread=476773 . If somebody knows the solution let's us know, please.

  • How to open a popup window through JSF

    Hi,
    I am new to JSF technology. I want to open a popup JSF page from home page. Is there any way to do that without using JS ? B'z i saw the link forum.exadel.com/viewtopic.php?t=559, In this he is using JS function to open the new window. I want to do that without using Script.
    Thanks in advance.
    Sudhakar

    assign a new frame name / window name to a form's target, when the form will be submitted, a new window will pop up
    But, AFAIK, you won't be able to set any of its properties (size, modal & so on), so JavaScript remains the best solution IMHO

  • How to get hidden field  in popup  window (using jsf)

    Hi,
    I have one hidden field in page first.jsp like <h:inpuHidden id="checkedVals" value="" />.
    from first page i am opening popup (second.jsp) by onclick with command button.
    how can i get the hidden field in second.jsp?
    I want to make a hidden field in second.jsp with the value of hidden filed in first.jsp
    Please help me....
    Thanks in advance

    Hi
    This can help you.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield    = 'input field name'
                dynpprog    = 'progname'
                dynpnr      = 'dynnum'
                dynprofield = 'structure-inputfield name'
                value_org   = 'S'
           TABLES
                value_tab   = tbl_values_tab.(values u want to get while pressing f4)
    Reward if it is useful.
    Thanks
    Siva Kumar

  • How do I create a printer friendly page in a popup window for a JSF page

    I have a JSF page that displays a table that shows the inventory level of a particular garment style. The table is like a matrix with each row representing a color of the style and each column representing a size of the garment. So the data in the table cell is for the inventory level of a particular color/size combination (e.g. navy blue of medium size ) for the particular style. The page also allows you to dynamically select a warehouse from a dropdown to see the inventory matrix of that warehouse.
    Now everything has been working fine except that the matrix table is not printer-friendly. So we need to have a Print button or link on the page that will generate a popup window that displays the same matrix table in a printer-friendly format (with different style sheet etc.). What is the best way to populate the matrix table in the popup? The data in the matrx table is stored in a hashmap in a InventoryManageBean of session scope.
    Also, shoud I use window.open to get the new window and if so what do I pass in the URL parameter?
    Any advice is appreciated. It would be great if you can include a code sample as I would think someone else must have had this done before.

    Any one please? This is urgent. Thanks a ton!

  • Jsf with popup window jsf and .xhtml?

    hi,
    HI,
    I am using example at http://www.jsftutorials.net/interface/jsf-popup.html
    for popup with jsf using javascript.
    In main form when click on button or link, i am opening popup window , and getting values
    from popup window to parent window.
    Here I need to pass some parameter or value to popup window without refresh the parent.
    I know with how to do jsp. but i am looking sample
    how to send parameters when we use parent and popup jsf forms with .xhtml.
    Thanks
    siva

    Hi Mainak,
    have a look to Thread:
    Popup Sizing
    As you can see there is not yet a way to set the Popup size.
    You have to find the good combination of fields and length in order to get a nice UI.
    The WDA engine try to set the best size, help it...
    Sergio

  • Error loading JSF page popup window - Cannot find FacesContext

    Hello,
    I am trying to load a popup window from my Visual Web JSF page. The popup window itself will be a Visual Web JSF page also.
    As an example, i have 2 buttons on my original page with jsp tags as follows::
    <webuijsf:button binding="#{Page1.button1}" id="button1" onClick="window.showModelessDialog('./PopupPage.jsp'); return false;"
    style="left: 19px; top: 16px; position: absolute" text="Button"/>
    <webuijsf:button actionExpression="#{Page1.button2_action}" binding="#{Page1.button2}" id="button2"
    onClick="window.showModelessDialog('./PopupPage.jsp');" style="position: absolute; left: 20px; top: 44px" text="Button"/>
    When i click Button1, the popup window appears but will not load the page within the window. I get the following report in the server log:
    StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
    java.lang.RuntimeException: Cannot find FacesContext
    at javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1811)
    at javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1628)
    at org.apache.jsp.PopupPage_jsp._jspx_meth_f_view_0(PopupPage_jsp.java from :102)
    at org.apache.jsp.PopupPage_jsp._jspService(PopupPage_jsp.java from :77)
    ETC ETC
    If i click Button2 (which does NOT return false in the onclick Script and thus submits the first page) the first attempt fails with the same error, but if i try a second time the popup window displays and loads the page correctly.
    Any solutions would be greatly appreciated as this is driving me crazy :-s
    Edited by: coxy69 on Jan 9, 2008 10:29 PM

    Cannot find FacesContextThis generally indicates that you invoked a request which points to a JSP page which contains JSF tags, but that the request itself isn't passed through the FacesServlet. Make sure that the request URL is covered by the url-pattern setting of the FacesServlet in the web.xml.

  • JSF 2.0 - Popup window

    I am new to JSF...i want to popup a small window in jsf...
    is there any tag to popup a window in jsf...something similar to woodstock bubble component?

    Nothing in the standard set of components.
    You'll need to continue to use 3rd party component libraries or write one yourself.

  • JSF popup Window example

    Can I get an example code for the following,
    When I click a button, I'm calling a data base
    procedure,
    data base procedure will validate the data,
    if there are any errors, the procedure will return an
    error message .
    I want to show a popup window with the returned error
    message,
    user should also able to choose "Yes" or "No" on the
    pop up window.
    I'm looking for the code to show the popup window with
    "Yes" and "No" buttons,
    when there is some error.
    I'm able to make it work by using ,
    import javax.swing.JOptionPane;
    int k = JOptionPane.showConfirmDialog(JOptionPane.getRootFrame(), errorMessage,"Warning",
    JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
    JOptionPane.showMessageDialog(JOptionPane.getRootFrame(), "Please Enter Part Number and Quantity" );
    The problem is this is using X-WINDOWS, for secuirity reason we are not running X-WINDOWS on DMZ.
    Thanks

    inputs = readonly
    buttons = disabled
    but just check with the api for which components support what
    Javascript might be a bit tricker.
    So what you want to do is have a javascript method on your form
    onsubmit="reutrn checkIsInError()""
    then in your checkIsInError function you need to check if the error popup is displayed
    multiple ways to do this none of them is great but i guess you can find the popup if it is not rednered then there is no error so reutrn true from
    checkIsInError() or you can put hidden components in your page and have their value = the boolean to check for error
    more ways to do this but it starts to become a hack doing it this way :)

  • Custom pushbutton in ME21N should display a popup window with item details

    Hello,,
    The requirement is to
    1. Add a custom pushbutton in ME21N screen at header level.
    2. The user will select some PO line items and will click on this push button.
        This inturn should trigger a popup window with item details only for those selected PO line items along with schedule line qty.
    I have created the custom push button in a custom tab using the BADI ME_GUI_PO_CUST.
    Now I am not able to retrieve item details and schedule line details inside the PAI of the custom tab..
    i.e., when i click on the custom push button, I am not able to retrive the item data and schedule line data.
    Please help me to retrive PO line item data and schedule line data.
    Regards,
    Sharah

    JSF is not so relevant in this question. It's all about how the generated client side code look like. Which is usually a bunch of HTML/CSS/JS (open page in browser, rightclick and view source). If you know HTML, you should know that using target="_blank" in a <form> or <a> element would open a new window. If you know JS, you should know that using window.open() would open a new window.
    Apply this so in the JSF source code so that the generated HTML/JS output is exactly what you want.

  • BUG: iPad displays 1cm border around content in task flow popup window

    I have tried this out on JDeveloper 11.1.1.6.0, 11.1.2.1.0 and 11.1.2.2.0 and each one seems to have the same problem. When displaying a taskflow in-line popup windows on an iPad (iOS 4.3.5 and iOS 5.1) a ~1cm border is displayed on the left, bottom and top of the window's content, with some of the content (also about 1cm) on the right being cut-off.
    I have also tried my app out on a Android Samsung Galaxy Tab (built-in browser), Android Samsung S1 (built-in) and on my Windows 7 PC in Safari and Firefox. None of these devices/browsers have this problem.
    To replicate this problem the following steps can be followed.
    1) Create a normal fusion web application.
    2) Add a wild card control flow rule to the default unbounded task flow.
    3) Add a new bounded task flow to the unbounded task flow.
    4) Set the bounded task flow 'Run as Dialog' to 'true' and 'Display type' to 'inline popup'.
    5) Link the wild card control flow to the bounded task flow.
    6) Add a single jsf page to the bounded task flow.
    7) Add a panel box to the jsf page (or any other content for that matter)
    8) Create a test page and add a button to it. Set up the button's action properties such that it opens the bounded task flow as a window ('UseWindow' - 'true'; 'WindowEmbedStyle' - 'window'; 'WindowModalityType' - 'modeless' and set width and height).
    Are any workarounds for this? Is there currently a available patch to fix this problem?

    Hi,
    Are any workarounds for this? Is there currently a available patch to fix this problem?
    if nobody dares reproducing this and filing it as a bug then a fix can take a while. I'll put it on a list of my follow ups, but this is not a high priority list. So if you can I appreciate if you can file the bug and provide a testcase. Note that 11.1.2 (11g R2) is not yet optimized for tablet PCs. So JDeveloper 11g R1 (11.1.1.6) is the build that should be used as a reference for filing the bug
    Frank

  • Can one create a floating window using JSF?

    I was recently shown the interface for GMail. I don't have a GMail account, but one of the things I was asked to investigate was whether or not we can create the sort of floating window that appears on the GMail interface when one positions the mouse pointer over a cell on the grid showing the email messgaes. We have a grid on our JSF page, that shows specific data for items we're supporting, and it would be useful if we could have something like a mouseover event handler for each table row, and in that event handler show a window with a graphic specific to the data in that row, and the chart would move with the mouse pointer, perhaps changing the graphic if the mouse pointer is moved over a different row in the data table.
    Can we do this using JSF? If not, what alternative can you suggest that would provide a reasonable facsimile to this kind of user friendly feature?
    Thanks
    Ted

    "Core JavaServer Faces" Second Edition, by David Geary and Cay Horstmann, copyr 2007 - ISBN: 0-13-173886-0 - (it put me back USD $50, but well worth it). Page 644 gives two examples of how to generate a pop-up window. They give two examples because of problems that can arise when you transfer data between the main window and the pop-up. I do not want to violate copyright and there are ten pages of text devoted to this topic, so I'll just present some tickler code - if you cannot afford the book, maybe you can google on some terms. Sorry, I feel this is as far as I can go on this, I hope this helps some!
    The first example uses a JavaScript call:
    popup = window.open(url, name, features);
    popup.focus();
    where 'features' is a string like "height=300,width=200,toolbar=no,menubar=no"
    The second example creates the pop-up form using a hidden field like this:
    <h:form id="hidden" target="popup">
    <h:inputHidden id="country" value="#{bb.country}"/>
    <h:commandlink id="go" action="showStates"/>
    </h:form>

  • Popup window question

    Hi,
    I did a Portal application using JSF and RAD 6.0 in the Portal page I have two portlets side by side the portlet in the right side has a link to open a popup window when I click in that link and the popup window opens the portlet in the left side is showing in the popup window is there any way to tell the popup np to show the portlet on the left side. I used jsf-popup
    thanks

    Here is how to open a TitleWindow and initialize some values
    in the newly opened TitleWindow.
    var myWin:
    YourTitleWin=YourTitleWin(PopUpManager.createPopUp( this,
    YourTitleWin , true));
    myWin.setParentRef(this);
    In the newly opened window you have to have a method
    setParentRef that accepts a window as an argument. Store the parm
    as a variable in the window.
    There are other ways to do this .. this is just one of
    them.

  • Web sphere portal popup windows

    Hi,
    I used this forum before with great results maybe some one can help me this time also.
    I'm working in a Websphere Portal project using JSF and RAD6 to create the portlets. I like the way it works execept when I try to create popup windows. How can I create popup windows that they don't keep context the only one I can create is the HelpView page. Is there a way to call other forms from Helpview like a redirect or something like that or is any other way to create popup windows any help or suggestion will be appreciated.
    Thanks

    i have followed line to line as per post installation tasks given in sun site. No logs are generated in policy agent. i.e
    bcoz policy agent is not at all intercepting the request. do we need to do any thing more to add a filter in websphere 6.1
    To give you background:
    This is a clustered enviornment and each node has 3 instances [ appserver,nodeagent, websphere_portal]
    we have installed the policy agent on each of the instances.
    Now when i access the admin interface my policy agent intercept redirect to SSO.
    When i access portal instance policy agent doesnt intercept
    there are no logs generated in accessmanager or policagent.
    Edited by: sat on Jun 29, 2008 11:18 AM

Maybe you are looking for

  • Return sales order

    Dear All,             While processing return sales for sales kit (IS R),which contains two sub items,pricing is done for main item,sub items are not there in invoice as they are not relevent for pricing but what if i need to create return order of o

  • Smart forms/ page

    Hi, i have problem with smart form reporting. page number up 10 is non displayed it is * before 10 it is ok . 1 of 12                       2 of 12                       3 of 12                       9 of * is this sap system bug?

  • How do i get the music on my itunes to sync without removing the music i presently have on my phone

    How do i sync with the music in itunes and not replace the music i presently have on my iphone 4S?  I just purchase more music and dont want to lose it.

  • Exit by user

    hi every body i have a program that start procedure which will take time,what i want is to enable user to stop this procedure during it is working by click in cancel button,just like cancel report button in Report Builder. null

  • Sales Order not getting into BI using 2LIS_11_VAITM

    Hi, I have created some new sales orders in R/3 System and I deleted the setup tables and reloaded the setup tables. Now I have reloaded my DSO in BI using 2LIS_11_VAITM and I do not see these new sales orders. Is there something that I am missing. I