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)

Similar Messages

  • 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.

  • 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

  • Popup window for tabular form row edition

    To edit existing or new rows in a tabular form (page 1), I would like to open a popup window (page 2) with fields mirroring original tabular form fields. So, some basic data can be viewed/typed in the tabular form and the whole of the record data are viewed/typed on a separate popup form.
    On opening popup, I pass a tabular form's current line number (filled with up to three zeros on the left).
    When the user clicks on OK button on popup page, data will be put to the corresponding tabular form row. That should allow me to get /set tab form data from popup using following syntax:
    opener.document.getElementById('f04_' + line).value
    However, when I call data-initialization javascript function on onload of the popup form, popup fields to be filled are not rendered yet. At which point (and how) could I call this javascript initialization function?
    Another question. With Firebug Inspector, I see that right in front of each tab form data tag, there is a "label" tag with the name of the column as it was defined in report attributes. As long as I have a information, opener.document.getElementById, what HTML/Javascript syntax should I use to get to this label tag?
    Igor

    OK, the first part of question is OK now. Simply, I was putting a javascript code calling my initialization predure in the HTML Body Attribute section of the page, instead of simply writing there: onload="initFunction();"
    The second one stands still: once I have a tabular form's element id like f20_0003, how can I get to the symbolic name, e.g., "FIRST_NAME", that is in the label tag in the same table cell?

  • 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

  • In a multiple monitor situation, how do I get popup windows to open on the same monitor as the parent application is displayed.

    I have two monitors. I have an application that I run all day, displayed on my secondary monitor. Whenever a popup windows is launched form that application, it always opens on the primary monitor. Very annoying. Any way to get the popup to launch in on the same monitor as the parent application?

    Did you solve this problem ?

  • 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

  • How to close the adobe forms in popup windows once.

    hi,expert..
    i show a adobe form in a popup windows in my webdynpro program...but i find out that i at least click twice on the "CLOSE" button on the right top of the window.....how can i modify my program to  close the window once..
    the original codes are as follow:
    method onactionprint .
       data lo_nd_zhrhap_vp_app_01 type ref to if_wd_context_node.
      data lo_nd_zhrhap_t_document type ref to if_wd_context_node.
      data lt_zhrhap_t_document type wd_this->elements_zhrhap_t_document.
      lo_nd_zhrhap_vp_app_01 = wd_context->get_child_node( name =
    wd_this->wdctx_zhrhap_vp_app_01 ).
      lo_nd_zhrhap_t_document = lo_nd_zhrhap_vp_app_01->get_child_node(
    name = wd_this->wdctx_zhrhap_t_document ).
      lo_nd_zhrhap_t_document->get_static_attributes_table(
        importing
          table = lt_zhrhap_t_document ).
    DATA lo_nd_zhrhap_s_app_leader TYPE REF TO if_wd_context_node.
    DATA lo_el_zhrhap_s_app_leader TYPE REF TO if_wd_context_element.
       data ls_zhrhap_s_app_leader type
    wd_this->element_zhrhap_s_app_leader.
    lo_nd_zhrhap_s_app_leader = lo_nd_zhrhap_vp_app_01->get_child_node(
    *name = wd_this->wdctx_zhrhap_s_app_leader ).
    lo_el_zhrhap_s_app_leader = lo_nd_zhrhap_s_app_leader->get_element(
    lo_el_zhrhap_s_app_leader->get_static_attributes(
       IMPORTING
         static_attributes = ls_zhrhap_s_app_leader ).
    DATA lo_nd_zhrhap_s_dates TYPE REF TO if_wd_context_node.
    DATA lo_el_zhrhap_s_dates TYPE REF TO if_wd_context_element.
       data ls_zhrhap_s_dates type wd_this->element_zhrhap_s_dates.
    lo_nd_zhrhap_s_dates = lo_nd_zhrhap_vp_app_01->get_child_node( name
    *= wd_this->wdctx_zhrhap_s_dates ).
    lo_el_zhrhap_s_dates = lo_nd_zhrhap_s_dates->get_element(  ).
    lo_el_zhrhap_s_dates->get_static_attributes(
       IMPORTING
         static_attributes = ls_zhrhap_s_dates ).
    采集表名称和日期
      data lo_nd_if_data type ref to if_wd_context_node.
      data lo_el_if_data type ref to if_wd_context_element.
      data ls_if_data type wd_this->element_if_data.
      lo_nd_if_data = wd_context->get_child_node( name =
    wd_this->wdctx_if_data ).
      lo_el_if_data = lo_nd_if_data->get_element(  ).
      lo_el_if_data->get_static_attributes(
        importing
          static_attributes = ls_if_data ).
      ls_zhrhap_s_dates-valid_begda = ls_if_data-begda.
      ls_zhrhap_s_dates-valid_endda = ls_if_data-endda.
    DATA lo_el_zhrhap_vp_app_01 TYPE REF TO if_wd_context_element.
       data ls_zhrhap_vp_app_01 type wd_this->element_zhrhap_vp_app_01.
       data lv_description like ls_zhrhap_vp_app_01-description.
    lo_el_zhrhap_vp_app_01 = lo_nd_zhrhap_vp_app_01->get_element(  ).
    lo_el_zhrhap_vp_app_01->get_attribute(
       EXPORTING
         name =  `DESCRIPTION`
       IMPORTING
         value = lv_description ).
    REPLACE ALL OCCURRENCES OF '类别:' in lv_description with ''.
      lv_description = ls_if_data-stext.
      data l_is_ok    type boole_d.
      data pdf_source type xstring.
      data l_msg      type ref to cl_hrpa_message_list.
      create object l_msg.
      call method zcl_hr_appraisal_utility=>print_contract_direct
        exporting
        form_type           = 'COD'
          zhrhap_t_document   = lt_zhrhap_t_document
          zhrhap_s_dates      = ls_zhrhap_s_dates
          zhrhap_s_app_leader = ls_zhrhap_s_app_leader
          description         = lv_description
        job_description     =
          message_handler     = l_msg
         importing
          is_ok               = l_is_ok
          pdf_xstring         = pdf_source
      check l_is_ok is not initial and pdf_source is not initial.
      data lo_nd_pdf type ref to if_wd_context_node.
      data lo_el_pdf type ref to if_wd_context_element.
      data ls_pdf type wd_this->element_pdf.
      data lv_source like ls_pdf-source.
      lo_nd_pdf = wd_context->get_child_node( name = wd_this->wdctx_pdf ).
      lo_el_pdf = lo_nd_pdf->get_element(  ).
      lo_el_pdf->set_attribute(
        exporting
          name =  `SOURCE`
          value = pdf_source ).
    *-->ADOBE View embeded to ViewContainer UI
      data: lr_view               type ref to if_wd_view_controller,
            lr_api_main           type ref to if_wd_component,
            lr_window_man         type ref to if_wd_window_manager,
            comp_usage            type ref to if_wd_component_usage,
            l_title               type string value '打印合同',
            lr_window             type ref to if_wd_window.
      lr_view = wd_this->wd_get_api( ).
      lr_api_main = wd_comp_controller->wd_get_api( ).
      lr_window_man = lr_api_main->get_window_manager( ).
    l_title = wd_colr_mp_controller->model->get_text( '006' ).
      call method lr_window_man->create_window
        exporting
          modal        = abap_true
          window_name  = 'POPUP'
          title        = l_title
          button_kind  = if_wd_window=>co_buttons_yesno
         message_type = if_wd_window=>co_msg_type_none
          default_button = if_wd_window=>co_button_yes
        receiving
          window       = lr_window.
      lr_window->open( ).
    endmethod.
    looking forward to your help....thanks in advance

    Ping,
    1st, see the Markup formatting options over on the right part of the screen - if you wrap your code between the code tags it will read MUCH better.
    2nd, I can't replicate this issue - we have several PDFs opening in new windows & we only need to click once on the clost 'X' - how are you calling the PDF in a new window?
    If you can't find a final resolution, an alternative would be to place a LinktoAction on your web dynpro application somewhere that makes sense which would close the window for you.
    We do this on Sucess Message Views...
    You can simply add the link to action to the screen, and in the event handler use
       data : l_view_cntr type ref to if_wd_view_controller,
           l_win_cntr  type ref to if_wd_window_controller,
           l_window    type ref to if_wd_window,
           l_parameter_list  type wdr_event_parameter_list,
           l_parameter       type   wdr_event_parameter,
           l_val type ref to data.
    field-symbols <fs> type any.
    l_view_cntr = wd_this->wd_get_api( ).
    l_win_cntr  = l_view_cntr->get_embedding_window_ctlr( ).
    l_parameter-name = 'CLOSE_WINDOW'.
    create data l_val type c.
    assign l_val->* to <fs>.
    <fs> = 'X'.
    l_parameter-value = l_val.
    insert l_parameter into table l_parameter_list.
    l_win_cntr->if_wd_view_controller~fire_plug(
    exporting plug_name = 'EXIT_PLUG'
               parameters = l_parameter_list ).
    Make sure you have an Exit plug on your Window with Plug Type EXIT.

  • Form in a popup window

    Hello
    I have a button on a page opening a popup window. This popup window includes a page with form and the classical Create Cancel Submit Delete buttons.
    Of course, when clicking Cancel, Submit or other buttons, the popup does not close and I end up with the target page in the popup !
    How can I solve this ? (I'm using apex 4)
    Edited by: Arnaud Ladrière on 26 août 2010 16:16

    Hi Arnaud,
    You may find it useful to refer to the Build Custom Popup Pages 'How To' available here: http://www.oracle.com/technetwork/developer-tools/apex/how-to-create-custom-popups-085945.html , which outlines the steps to create the popup, including the JavaScript to pass back values to the parent page and then close the popup.
    There's also numerous related threads on the forum which could also prove useful to you:
    http://forums.oracle.com/forums/search.jspa?threadID=&q=how+to+close+popup+window&objID=f137&dateRange=last90days&userID=&numResults=15
    Regards,
    Hilary

  • 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!

  • Generating a Popup window based on BPM Form outcome

    Hi All,
    I'm currently working with a BPM workflow which is going through 6 levels.
    Each level having there own forms and each form having different customized buttons to flow the task to different paths. e.g; ASSIGN, CANCEL, RECHECK etc.
    These buttons are the outcomes of the Human Task. (I did not add 'Button' from components)
    I have a requirement to generate a popup window based on some of the button actions.
    This popup will have only two options.
    e.g -
    Popup window will ask 'Are you sure to proceed ?' then there should be two buttons to select Yes or No.
    'Yes' will send the instance to next stage and 'No' will remain the instance in the same user inbox.
    How do I do this ???
    Thanks,
    Nir

    Hi All,
    I found the way to generate the popup.
    But now my problem is how can I navigate( Complete the task from that level) the task from the Inbox after clicking OK button.
    There are several customized buttons in the form (e.g 'APPROVE', 'RECHECK' , 'CANCEL' etc.)
    I want to make the instance navigate to next level based on the button clicked.
    e.g.
    1. User will click on the 'CANCEL' button
    2. Popup will display to confirm the action
    3. When user click OK in the popup window task should be 'CANCELLED'
    (My problem is how to catch the button action he has performed )
    Any Ideas ??
    Thanks,
    Nir

  • To Open 11g Forms output on a seperate popup window

    Hi,
    Anybody help me, how to Open 11g forms output on a seperate popup window. Now it is comming in browser itself.
    regards
    Ahamed Rafeeque CH

    This is controlled in the Forms Services configuration. You will need to modify the "separateFrame" configuration setting using the WebLogic Server interface. You could also modify the formsweb.cfg using a standard text editor, but it is not recommended. The default value for separateFrame is FALSE. By setting the value to TRUE it instructs Forms Services to use a seperate browser window for the Java Applet.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • 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.

  • Opening a Form in a popup window

    Hi,
    What's the easiest way to open a Form in a popup window? Do I use Javascript or is there another way? Is there a documented example either in Technet or Metalink?
    Thanks,
    Steve West

    Hi,
    For further information you can see the following reply
    Re: Fax and voice solution technical details!
    Thanks
    Vineet

Maybe you are looking for

  • Convert Smartform Output to PDF

    Hi all, I am trying to save Output of Smartform in PDF file format. for that purpose i am calling "CONVERT_OTF" FM from my driver program. But it is giving me Information "OTF end command // missing in OTF data" while executing FM "CONVERT_OTF". i de

  • How to work with files in folders on Application/Presentation Server

    Hi, I am working on interface program in which files are populated in folders in application/presentation server in the format 'ABCsy-datumsy-uzeit.txt'(e.g.ABC20051022161450.txt,ABC20051022161455.txt ) in directory c:\temp. I want to sort all these

  • My firefox keeps crashing! Can anyone help?

    I have tried to re-install several times, safe mode,hardware accel, reset firefox. However it still keeps crashing every few minutes and i get the message "sorry firefox has crashed" and the option to send a report and restart/quit firefox

  • I just upgraded Dreamweaver CS5 to CC - sites did not migrate - how to get my sites back?

    I just upgraded Dreamweaver CS5 to CC - sites did not migrate - how to get my sites back? (I'd rather not recreate them all from scratch) PS - Go easy on me - it's my first post in this forum . Thanks, Rob

  • Java.io.IOException: Not enough space

    Hi, I get the following error after running Weblogic 4.5.1 on Solaris 2.7 (1GB Ram). for a couple of days. At first I thought it was running out of File Descriptors. I increased them to 4096 from 1024. But the problem still exists. I am unable to fin