How to Close the launchDialog of AdfFacesContext in Bean

Hi,
In my application i am opening a new dialog by using the API "launchDialog" of AdfFacesContext. I have one issue regarding client requirement. Here when user clicks on a launch button, it will launch a new dialogue as per the code written. But if user clicks on that launch button again and again without closing the already launched dialog, it keeps on opening as many new dialogues.
But it should not be the case as per requirement. My requirements are listed below.
1. If the dialogue is already opened, it should set focus to that rather opening a new dialogue.
2. Is it possible to close the launched dialogue from bean??
Can anyone help me regarding this???
Example code written
FacesContext context = FacesContext.getCurrentInstance();
UIViewRoot dialog = (UIViewRoot) JSFUtils.getFromSession("HelpViewRoot");
if (dialog == null) {
// Create the dialog UIViewRoot
ViewHandler viewHandler = context.getApplication().getViewHandler();
ViewHandler viewHandler = context.getApplication().getViewHandler();
dialog = viewHandler.createView(context, "/help/help.jspx");
dialog.setId("CALWINHELP");
JSFUtils.storeOnSession("HelpViewRoot", dialog);
RichCommandButton rcb = (RichCommandButton) JSFUtils.findComponentInRoot("helpBtnId");
HashMap properties = new HashMap();
properties.put("width", new Integer(200));
properties.put("height", new Integer(150));
properties.put("windowEmbedStyle", "inlineDocument");
HashMap parameters = null;
AdfFacesContext afContext = AdfFacesContext.getCurrentInstance();
DialogService ds = afContext.getDialogService();
if (ds.peekView() != null) {
ds.pushView(ds.peekView());
}else {
afContext.launchDialog(dialog, parameters, // no particular parameters
rcb, // launched from component - RichCommandButton
true, // show it in a dialog
properties);
Thanks & Regards
Perumal S

Hi,
according to the JavaDocs you can't. See: http://myfaces.apache.org/trinidad/trinidad-api/apidocs/org/apache/myfaces/trinidad/context/DialogService.html
Frank

Similar Messages

  • How to close the detach popup on click of a button in the panel collection

    Hi,
    I'm using Jdeveloper 11.1.2.3.0.
    I have an af table surrounded by panel collection. There is a button on panel collection to commit the changes in the table.
    Clicked detach button to view the table in full browser.
    On click of Commit button, the detach popup is not closed. I have set partialSubmit of that button to false. Then also detach popup is not closed.
    Can anybody suggest me how to close the detach popup on click of a button in the toolbar.
    Thanks,
    Vinod

    Hi Frank,
    Thanks for your response. Popup is not closed.
    I tried this approach, when the view tree is navigated on the Detach, I see that the tree is same as if it is traversed on the page without detach.
    Printed client id and UI component class in the while loop, result is as below.
    r1:0:pc1:t3 class oracle.adf.view.rich.component.rich.layout.RichToolbar
    r1:0:pc1 class oracle.adf.view.rich.component.rich.output.RichPanelCollection
    r1:0:ph2 class oracle.adf.view.rich.component.rich.layout.RichPanelHeader
    r1:0:pgl1 class oracle.adf.view.rich.component.rich.layout.RichPanelGroupLayout
    r1 class oracle.adf.view.rich.component.rich.fragment.RichRegion
    pgl1 class oracle.adf.view.rich.component.rich.layout.RichPanelGroupLayout
    db2 class oracle.adf.view.rich.component.rich.layout.RichDecorativeBox
    db1 class oracle.adf.view.rich.component.rich.layout.RichDecorativeBox
    psl1 class oracle.adf.view.rich.component.rich.layout.RichPanelStretchLayout
    ps1 class oracle.adf.view.rich.component.rich.layout.RichPanelSplitter
    f1 class oracle.adf.view.rich.component.rich.RichForm
    Tried with setting partialsubmit property to false on the command button, still the popup is not closed and my Faces Message are shown behind the detach popup.
    Thanks,
    Vinod

  • How to close the COM Port ??????????

    Dear all :
    I have written an application that send AT commands to a modem , Once I opened a com port , i don't know how to close it . I got the null pointer exception when i create a new channel , because the inputStream and outputStream is owned by the previous channel . So , some one can teach me how to close the com port that opened before ?
    my source code for open port :
    public void Connect_Com(CommPortIdentifier portId) {
    Integer i = new Integer((int) (Math.random()* 1000));
    String channel = "channel" + i.toString();
    System.out.println(channel);
    try {
    System.out.println("preparing to open port");
    serialPort = (SerialPort) portId.open(channel, 2000);
    } catch (PortInUseException e) {}
    try {
    inputStream = serialPort.getInputStream();
    System.out.println("getting inputStream");
              } catch (IOException e) {}
    try {
    serialPort.addEventListener(this);
              } catch (TooManyListenersException e) {}
    serialPort.notifyOnDataAvailable(true);
    try {
    serialPort.setSerialPortParams(9600,
    SerialPort.DATABITS_8,
    SerialPort.STOPBITS_1,
    SerialPort.PARITY_NONE);
    } catch (UnsupportedCommOperationException e) {}

    serialPort.close() ?
    From the documentation of SerialPort:
    - SerialPort extends CommPort.
    - CommPort.close() closes the communications port.

  • How to close the window openned by System Exec VI automatica​lly?

    Hello,
    I am using System Exec VI to lauch an exe file built from a LabVIEW program. When running System Exec VI, the window of exe file pop out and stays there even after all tasks are completed. I have to close it every time manually. Anyone here know how to close the exe file window automatically when it's done?
    Thanks,
    Jean
    Message Edited by Jean_CLD on 03-25-2010 11:25 AM
    Message Edited by Jean_CLD on 03-25-2010 11:29 AM
    Solved!
    Go to Solution.

    If I understand the question correctly you need to add an invoke node at the end of your application to exit. Depending on the whether it is running as a stand alone application or within LabVIEW it will either exit or stop execution. I've attached the VI I use in my applications.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot
    Attachments:
    Exit application.vi ‏13 KB

  • I want know how to close the time capsule the "DHCP"

    Dear Sir,
            I want to know how to close the "dhcp" on time capsule. Tks!
    Br,
    William

    If you are on Lion download the utility that actually works, 5.6 as v6 is useless.
    Go to manual setup, go to the Internet tab, go to DHCP, turn it off.
    That will then require you to manually set dhcp or use a different dhcp server but pointing back to the TC as gateway. If you are using something else as main router, just bridge the TC, that will automatically turn off DHCP.

  • How to close the Scheduling Agreement

    how to close the scheduling agreement
    means i don't want to procure the material any more against the Scheduling agreement.

    Abhishek
    Please follow the below procedure.
    You block items in Schedule  agreements to prevent release orders or delivery schedules (in the latter case, including SA releases) being created against the agreement. For example, you may want to block an item if a vendor has delivered goods of poor quality.
    Procedure
    1.     Choose Schedule agreement Change.
    2.     Specify the number of the outline agreement. Then press ENTER .
    3.     Select the item(s) you wish to block. Then choose Edit Block.
    The system inserts an S in the column D, indicating that the item is blocked.
    To unblock the item, select it and then choose Edit Reset deletion indicator.
    4.     Save the agreement.
    or
    You can delete the item in schedule agreement
    Thanks & Regards,
    Sridhar

  • How to close the open PO's

    Hi Guys,
    I have a issue.
    User create a PO with out any assingment category. However vendor sent the goods directly to the customer.GR has done for this PO, but invoice not yet done. These thing done 4 years ago.
    Now user wants to close the PO.
    How can we close the PO with out effect on customer and vendor.
    Note: there is no stock maintained presently for that material with the plant 0299.
    even invoice had not done, that is not effected on FI account.
    So please advise me.
    Thanks,
    Saran.

    Hi,
    What is the error message you got while trying to delete the PO item.As the goods were delivered and made the GR, invoicing cycle also needs to be completed.Does the vendor was paid during that time?.
    Please try deleting the PO item and act as per the error message you got.
    If the cycle of the PO is completed and if you try to delete it , it will not effect the vendor/customer.
    Regards,

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

  • How to close the report background engine programatically in developer 6.0?

    Friends,
    We have developed our application using Oracle Developer 6.0 as front end and Oracle 9iR2 as a back end.
    whenever the user is opening the application one session is creating after that if he runs any report the report background engine is started and that engine also creating one session. So, unnecessarily two sessions are opening for a single application.
    So, how can we close the report background engine programatically after the report displays all the records?
    Moreover, when the user close the application, the report background engine is still open. the user has to close the report background engine manually.
    so how can we solve this issue?
    Thanks
    Sathyguy

    i got this while searching but its not working.....
    Problem Description
    Starting reports using a RUN_PRODUCT on Windows platforms starts a
    Reports Background Engine (RBE). After leaving the forms application the
    background engine is still running and must be terminated by the user.
    Solution Description
    This is intendet behaviour.
    To close the Background Engine programmatically use the Reports Runtime parameter
    ORACLE_SHUTDOWN. E.g.
    Perform the following actions to stop the RBE when closing the Forms
    application:
    1) Create a dummy report which only does e.g. a SELECT * FROM DUAL
    This report has a DESTYPE=FILE and a DESNAME to e.g. C:\TEMP\DUMMY.OUT
    2) In the POST-FORMS trigger add the following code:
    DECLARE
    pl_id ParamList;
    BEGIN
    pl_id := Create_Parameter_List('dummy');
    Add_Parameter(pl_id,'ORACLE_SHUTDOWN',TEXT_PARAMETER,'Yes');
    Add_Parameter(pl_id,'PARAMFORM',TEXT_PARAMETER,'NO');
    Run_product(REPORTS,'<<name dummy rapport>>',SYNCHRONOUS, RUNTIME,
    FILESYSTEM,pl_id,NULL);
    END;
    Explanation
    The Report Background Engine runs separately from the Forms application and
    there is no direct relation between these processes. The Forms should signal
    the RBE that is being closed.
    When the Form is closed the POST-FORM triggers sends a dummy report to
    the RBE. Since the ORACLE_SHUTDOWN=Yes parameter is used after running the
    report the RBE is terminated.
    A small side-effect of the solution is that a small file (5Kb) is created on
    the file-system contaning the output of the dummy report.

  • How to close the computer since mail doesn't work?

    Hi all,
    I don't know why my mail doesn't work. due to it, I can't close the macbook pro.
    How to solve it?
    Thanks
    Lilian

    Click on the Apple Symbol in the Task Bar (Top Left Corner) and choose forece quit. This should close mail and your Macbook should be able to restart...

  • How to close the main window  from Popup

    hello all,
    i need to close the main window from a popup, so i create a popup and after clicking on close button of this popup, should also the main window be closed.
    how can do this please?
    BR

    Hi
    Please go through this.. check thomas reply
    Re: Close Main Window directly on action on Pop up window
    also check this..
    how to close main window on click of a button on popup window
    cheers,
    Kris.
    Edited by: kissnas on May 12, 2011 5:06 PM

  • How to close the Sound object

    I'm using Flash CS3, running code in ActionScript 3.
    I use the Loader class to load a child SWF file, which then
    takes over the entire area on my website that is reserved for
    Flash. If the user decides to stop watching the SWF file before it
    is completed, he hits the "close" button within the child SWF,
    ultimately causing the Loader.unload() method to be executed. So
    far, so good, only the sound from the remaining portion of the SWF
    file keeps playing. According to the Flash Docs for the
    Loader.unload() method:
    "As a best practice, before you unload a child SWF file, you
    should explicitly close any streams in the child SWF file's
    objects, such as LocalConnection, NetConnection, NetStream, and
    Sound objects. Otherwise, audio in the child SWF file might
    continue to play, even though the child SWF file was unloaded."
    It then gives an example that assumes you already have access
    to the Sound object, so closing the Sound object is done by:
    mySound.close();
    The only problem is that I have no idea how to access the
    Sound object when I use the Loader.load() method. Where is this
    beast? I can't seem to find anything in the documentation that
    tells me how to find the Sound object after calling Loader.load().
    As a temporary fix, I modified the target SWF file so that when the
    "close" button is hit, it calls the "stop()" function; however,
    this only stops the sound, it does not close the associated Sound
    object, and I presume it continues to lurk around in memory with
    nothing useful to do. (When the user hits the "close" button in the
    child SWF file, it creates a "bubbling" event so that the Loader
    class can call the Loader.unload() method on it.)
    I've attached code for your reference.
    Any help is deeply appreciated!
    -Dan

    Ack! Looks like I hijacked this thread, sorry.
    I'm doing almost exactly the same thing the OP is doing...
    Loader class to load an external SWF (which is a video file FLV).
    If the user hits the "close" button on the video, the video goes
    away as it should but the audio continues.
    I understand that I need to close any NetConnection and
    NetStream objects in addition to unloading the movie. What I don't
    understand is how to do that. I'm sure that it's a syntax thing I'm
    just not getting right. I would just really like a more detailed
    explanation of stopping NetConnections and NetStreams (but an
    explanation for the not-so-actionscript-experienced LOL).
    Thanks.

  • How to close the parent process.

    Hello World
    I am trying to open the external process like word using Runtime.exec(). The code below works perfectly fine. But I want to close the parent process. And only word file should remain on. How to do this? Experts please comment.
    Regards,
    Sachin Dare.
    import java.io.*;
    class Test {
    public static void main(String[] args) {
    try {
    String cmd[] = new String[3];
    cmd[0]= "cmd.exe";
    cmd[1]= "/C";
    cmd[2]= "C:\\Sachin\\EvicDocs\\sst58.doc";
    Process process = Runtime.getRuntime().exec(cmd);
    if(process != null) {
    StreamHandler errorGobbler = new StreamHandler(process.getErrorStream(), "ERROR");
    StreamHandler outputGobbler = new StreamHandler(process.getInputStream(), "OUTPUT");
    errorGobbler.start();
    outputGobbler.start();
    int exitVal = process.waitFor();
    System.out.println(" Exit Value is : " + exitVal);
    if(exitVal != 0) {
    throw new Exception();
    } else {
    System.out.println("Process is destroying......");
    process.destroy();
    catch(Exception e) {
    e.printStackTrace();
    class StreamHandler extends Thread {
    InputStream is;
    String type;
    StreamHandler(InputStream is, String type) {
    this.is = is;
    this.type = type;
    public void run() {
    try {
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line=null;
    while ( (line = br.readLine()) != null) {
    System.out.println(type + ">" + line);
    br.close();
    isr.close();
    } catch (Exception e) {
    e.printStackTrace();
    }

    If you mean by "parent process " the java one starting e.g. Word, then say System.exit() after having launched the child process. Hopefully Word will not take care of stdin, stdout or err so this arrangement will be okay.

  • HT4064 How to close the function in iPad

    HOw to close function in I pad

    Close inactive apps?
    1. Double tap the home button to bring up the multi-tasking view
    2. Swipe the app upwards to close
    3. The app will fly off the screen

  • TS1717 I can't run an update in iTunes until I know how to close the account. Can someone please help me?

    I need to run an update for iTunes but it won't run until I 'close' it.  Could someone tell me how to do this? Just clicking on the red button
    doesn't work. Thanks

    Which are you working on, a Mac (which you state in your profile and would seem to be indicated by your reference to a "red button") or a Windows system (this being the iTunes for Windows forum) and what OS version are you running?
    If you're running a Mac, clicking the red "close" button just closes the window; it does not quit the iTunes program. You have to actually use the Quit iTunes command.
    Regards.

Maybe you are looking for

  • Can I create a process creation log?

    While trying to help a colleague resolve some odd MacBook Pro behavior, I noticed that his system, within about 15 minutes of a restart, has PIDs in the 25000 range. I know how to use the process top to show active processes, the ~1 second update int

  • Oracle 10g enterprise edition in ubuntu

    how to install oracle 10g enterprise edition in ubuntu 11.04 (32bit). i have downloaded from http://www.oracle.com/technetwork/database/10201linuxsoft-097986.html . thanks in advance.

  • Wie kann ich RAW Daten von fuji X-E2 in Lightroom 4.4 importieren?

    wie kann ich RAW Daten von fuji X-E2 in Lightroom inportieren?

  • Ix4-300D cannot remove mapped drives

    Windows 8.1 Pro When I go to "disconnect" the currently mapped drives (to the ix4-300D) they disconnect.  When I reopen My Computer the maps are all back. Moderator comment: Remark(s) contravening the Community Rules removed - implied profanity/profa

  • Interesting Music Vid Import Issue

    Hey there, My buddy does drum covers to songs and posts them on Youtube.  I used tubekeeper.com to snag the HD-format MP4's off of the net.  I have 5 total.  They all imported into iTunes just fine.  Only 1 of them has audio associated with it though