Modal dialog issue

I have subclassed JDialog in way that permits me to use it like this: String data = DialogUI.getData(...);
However, it seams as if I have two conflicting requirements. I want the dialog to block until the user has made a selection. Then, the selection should be returned as illustrated. However, I want the dialog to close if they move to a different field.
Is there a way (a hack) to close a modal dialog if the user clicks some outside the boundaries?
If I have to make it non-modal, is there a way to make the dialog return a value when the dialog is closed?
Also, does the following code make since, from an architecture and design view point?
Next
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Insets;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Date;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
class DialogUI extends JDialog {
  private JButton _btnOk = null;
  private JPanel _pnlMain = null;
  private JPanel _pnlSouth = null;
  protected JPanel _pnlCenter = null;
  private String _result;
  public DialogUI(Frame frame){
    super(frame, "", true);
    _pnlSouth = new JPanel();
    _pnlSouth.setPreferredSize(new Dimension(0, 40));
    _pnlSouth.setMinimumSize(new Dimension(0, 0));
    _pnlSouth.setMaximumSize(new Dimension(0, 0));
    _pnlCenter = new JPanel();
    _pnlMain = new JPanel();
    _pnlCenter.setOpaque(true);
    _pnlMain.setLayout(new BorderLayout());
    _pnlMain.add(_pnlSouth, BorderLayout.SOUTH);
    _pnlMain.add(_pnlCenter, BorderLayout.CENTER);
    BoxLayout layout = new BoxLayout(_pnlSouth, BoxLayout.X_AXIS);
    _pnlSouth.setLayout(layout);
    _btnOk = new JButton("OK");
    _btnOk.setPreferredSize(new Dimension(50, 0));
    _btnOk.setText("OK");
    _btnOk.setActionCommand("OK");
    _btnOk.setMargin(new Insets(1,0,1,0));
    _pnlSouth.add(Box.createHorizontalGlue());
    _pnlSouth.add(_btnOk, null);
    this.getContentPane().add(_pnlMain);
    _btnOk.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent event){
        _result = String.valueOf(new Date());
        dispose();
  public void open(){
    setSize(new Dimension(200, 100));
    setVisible(true);
  public static String getData(JComponent invoker) throws Exception{
    Frame frame = (Frame)javax.swing.SwingUtilities.getRoot(invoker);
    DialogUI dsw = new DialogUI(frame);
    dsw.setUndecorated(true);
    Point p = new Point();
    if(invoker != null){
      p.x = invoker.getLocationOnScreen().x;
      p.y = invoker.getLocationOnScreen().y + invoker.getHeight();
      dsw.setLocation(p);
    dsw.open();
    return dsw._result;
public class TextMP extends JPanel {
  private JTextField _text;
  private JButton _button;
  public TextMP() {
    _text = new JTextField();
    _button = new JButton("X");
    setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
    add(_text);
    add(_button);
  public JButton getButton() {
    return _button;
  public JTextField getText() {
    return _text;
  public static void main(String[] args) {
    final TextMP t = new TextMP();
    t.getButton().addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        try{
          String data = DialogUI.getData(t.getButton());
          t.getText().setText(data);
        catch(Exception e){
          e.printStackTrace();
    JFrame frame = new JFrame();
    frame.getContentPane().add(t);
    frame.setSize(400, 300);
    frame.setVisible(true);
}

You should decide what is more important - forcing the end user to enter something, or allowing a default value.
If you do the former, then keep it modal. If the later, then non-modal and default the field.
I did not read through your code and so I don't know what you are trying to design. But I will say that it makes more sense in general (thinking of how most forms are designed - whether they be applications for the desktop, or the web) you allow the user to navigate over the form and enter or not at will. Then when some event is triggered - often a button being pressed - then you validate the entire form (or part of it if it is embedded in larger unit) and force entry or default depending on needs.
~Bill

Similar Messages

  • Modal dialog issue - very urgent

    Hi everyone,
    i'm working with indesign application under asp.net. I'm using Interop.InDesign.dll. I'm able to open Indesign, but when i try to change UserInteractionLevel, then application returns error "Cannot handle the request because a modal dialog or alert is active." I can't see what modal dialog is opened because, i can't see Indesign window. It is runing in asp.net context.
    When i'm opening manually Indesign then none of the modal dialogs is active.
    My code:
    Type indAppType = Type.GetTypeFromProgID("InDesign.Application");
    objInDesign = (InDesign.Application)Activator.CreateInstance(indAppType, true);
    objInDesign.ScriptPreferences.UserInteractionLevel = idUserInteractionLevels.idNeverInteract;
    Do you have any solutuion for it ?
    Thanks.
    Regards

    I have similar issues.
    Initially this was caused by the splash dialog that appears the first time a user launches InDesign.  Logging in with the credientals used to launch InDesign, and checking the "Dont show again" checkbox cleared it up for me.
    Later, I ran into the problem again when InDesign was trying to recover some autosaved files.
    This was cleared up by deleting the recovered file information from the accounts AppData folder.
    I'm now getting this error again, but so far I dont know why. I have no Idea what modal dialog InDesign is trying to display.  How can I tell?
    I've got to say, I'm very disapointed with this behavior.
    If a programmer sets ScriptPreferences.UserInteractionLevel to InDesign.idUserInteractionLevels.idNeverInteract;  this should inform InDesign that its launch is part of an automated process; there is no user available to press anything, and there is likely not a desktop to display anything.
    It is far more important for InDesign to respect the ScriptPreferences.UserInteractionLevel than to try and recover documents or display a welcome dialog.
    But since we are stuck with this exception, I have the following questions:
    Is there a way to programmatically dismiss the splash "Welcome" dialog via script command?
    Is there a way to programmatically respond to the dialog that is displayed when InDesign has recovered documents?
    Is there a way to programmatically determine what modal dialog is causing the exception? (app.Dialogs is empty)
    Thanks!

  • In Unix, main JFrame focus not regained after modal dialog exit.

    Hi all,
    I'm new to this forum so hopefully this is the right place to put this question.
    I have a relatively simple GUI application written in Java 6u20 that involves a main gui window (extends JFrame). Most of the file menu operations result in a modal dialog (either JFileChooser or JOptionPane) being presented to the user.
    The problem is that when running on Unix (HPUX), the process of changing focus to one of these modal dialogs occasionally results in a quick flash of the background terminal window (not necessarily that used to launch the Java), and the process of closing the modal dialogs (by any means, i.e. any dialog button or hitting esc) doesn't always return focus to the main extended JFrame object, sometimes it goes to the terminal window and sometimes just flashes the terminal window before returning to the main JFrame window.
    I think the problem is with the Unix window manager deciding that the main focus should be a terminal window, not my Java application, since the problem occurs in both directions (i.e. focus from main JFrame to modal dialog or vice versa).
    In most cases of JOptionPane, I DO specify that the main extended JFrame object is the parent.
    I've tried multiple things since the problem first occured, including multiple calls to a method which calls the following:
    .toFront();
    .requestFocus();
    .setAlwaysOnTop(true);
    .setVisible(true);
    ..on the main JFrame window (referred to as a public static object)...
    just before and after dialog display, and following selection of any button from the dialogs. This reduced the frequency of the problem, but it always tends to flash the terminal window if not return focus to it completely, and when it occurs (or starts to occur then gets worse) is apparently random! (which makes me think it's an OS issue)
    Any help appreciated thanks,
    Simon
    Self-contained compilable example below which has the same behaviour, but note that the problem DOESN'T occur running on Windows (XP) and that my actual program doesn't use auto-generated code generated by a guibuilder:
    * To change this template, choose Tools | Templates 
    * and open the template in the editor. 
    package example;  
    import javax.swing.JOptionPane;  
    * @author swg 
    public class Main {  
         * @param args the command line arguments 
        public static void main(String[] args) {  
            java.awt.EventQueue.invokeLater(new Runnable() {  
                public void run() {  
                    new NewJFrame().setVisible(true);  
    class NewJFrame extends javax.swing.JFrame {  
        /** Creates new form NewJFrame */ 
        public NewJFrame() {  
            initComponents();  
        /** This method is called from within the constructor to 
         * initialize the form. 
         * WARNING: Do NOT modify this code. The content of this method is 
         * always regenerated by the Form Editor. 
        @SuppressWarnings("unchecked")  
        // <editor-fold defaultstate="collapsed" desc="Generated Code">  
        private void initComponents() {  
            jMenuBar1 = new javax.swing.JMenuBar();  
            jMenu1 = new javax.swing.JMenu();  
            jMenuItem1 = new javax.swing.JMenuItem();  
            jMenu2 = new javax.swing.JMenu();  
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);  
            jMenu1.setText("File");  
            jMenuItem1.setText("jMenuItem1");  
            jMenuItem1.addActionListener(new java.awt.event.ActionListener() {  
                public void actionPerformed(java.awt.event.ActionEvent evt) {  
                    jMenuItem1ActionPerformed(evt);  
            jMenu1.add(jMenuItem1);  
            jMenuBar1.add(jMenu1);  
            jMenu2.setText("Edit");  
            jMenuBar1.add(jMenu2);  
            setJMenuBar(jMenuBar1);  
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());  
            getContentPane().setLayout(layout);  
            layout.setHorizontalGroup(  
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)  
                .addGap(0, 400, Short.MAX_VALUE)  
            layout.setVerticalGroup(  
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)  
                .addGap(0, 279, Short.MAX_VALUE)  
            pack();  
        }// </editor-fold>  
        private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {  
            int result = JOptionPane.showConfirmDialog(this, "hello");  
        // Variables declaration - do not modify  
        private javax.swing.JMenu jMenu1;  
        private javax.swing.JMenu jMenu2;  
        private javax.swing.JMenuBar jMenuBar1;  
        private javax.swing.JMenuItem jMenuItem1;  
        // End of variables declaration  
    }

    It won't comfort you much, but I had similar problems on Solaris 10, and at the time we traked them down to a known bug [6262392|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6262392]. The status of this latter is "Closed, will not fix", although it is not explained why...
    It's probably because the entry is itself related to another, more general, bug [6888200|http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=b6eea0fca217effffffffe82413c8a9fce16?bug_id=6888200], which is still open.
    So it is unclear whether this problem will be worked upon (I suspect that yes) and when (I suspect that... not too soon, as it's been dormant for several years!).
    None of our attempts (+toFront(...)+ etc...) solved the issue either, and they only moderately lowered the frequency of occurrence.
    I left the project since then, but I was said that the workaround mentioned in the first bug entry (see comments) doesn't work, whereas switching to Java Desktop instead of CDE reduced the frequency of the issues (without fixing them completely either) - I don't know whether it's an option on HPUX.
    Edited by: jduprez on Jul 9, 2010 11:29 AM

  • How to make a dalog process custom events when blocked by modal dialog

    Hi,
    I would like to understand the way modal dialogs block other dialogs so that I can properly solve an issue I'm having with two modal dialogs, one blocking the other.
    I have an application, netbeans platform based, that opens a JDialog, NewDiskDlg, with it's modal property set to true. This dialog is responsible for starting a thread that will process a given number of files, from time to time, depending on some conditions, this thread will send events to the NewDiskDlg.
    When this thread is started, the NewDiskDlg creates a new JDialog, also with the modal property set to true. Both dialogs have the same parent, the main window. And this works as I expected, the second dialog, ActiveScanningDlg, opens on top of the NewDiskDlg and, until the thread stops, the dialog stays visible.
    When the thread stops an event is sent to this two dialogs signaling that the job has been completed, and here is my problem. The second dialog, the one that is visible when the event arrives, receives the event and executes the dispose() method, releasing control to the NewDiskDlg in the back, but the NewDiskDlg does not receive the event and does not process it correctly.
    I understand the no input can be sent to a blocked window, but does that include calling upon the window's methods?
    I've been looking for some help on this but my search terms are not good enough to provide me with any useful information. I've also read the topic on the focus system that is present in the Java Tutorial but I feel that that is not what I should be looking at.
    The following code is a snippet of the important parts that I described:
    NewDiskDlg has the following methods to process the events
        public void readingStarted(ReadingEvent evt) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    scanningDlg.showCentered();
        public void readingFile(ReadingEvent evt) {
            //DO NOTHING
        public void readingStopped(ReadingEvent evt) {
            Lookup.getDefault().lookup(MediaReader.class).removeListener(this);
            if (!showAgain) {
                dispose();
        public void readingAborted(ReadingEvent evt) {
            JOptionPane.showMessageDialog(this, "", "", JOptionPane.ERROR_MESSAGE);//TODO: i18n on the error messagens
            Lookup.getDefault().lookup(MediaReader.class).removeListener(this);
        }ActiveScanningDlg processes the events like this:
        public void readingStarted(ReadingEvent evt) {
            //DO NOTHING
        public void readingFile(ReadingEvent evt) {
            jpbReadingProgress.setString(evt.getCurrentFileName());
        public void readingStopped(ReadingEvent evt) {
            Lookup.getDefault().lookup(MediaReader.class).removeListener(this);
            dispose();
        public void readingAborted(ReadingEvent evt) {
            readingStopped(evt);
        }This is an example on how the events are sent:
        private void fireReadingFile(ReadingEvent evt) {
            for (ReadingListener l : listeners) {
                l.readingFile(evt);
        }

    Hi,
    You have to check the Tolerance limits set for the following tolerance keys. In case if any where the limit is breached the systems blocks the Invoice as 'R - Invoice verification'. Please check the limits set for all these keys.
    AP - item amount variance (if you have activated the item check)
    DQ and DW - for Quantity variance
    PP - price variance with the order price
    ST - date variance
    VP - Moving average price variance
    Regards,
    Kathir

  • Item not being saved when item is in a jquery modal  dialog

    Hi all,
    I followed instructions found here :
    http://shijesh.wordpress.com/2010/04/10/jquery-modal-form-in-apex-4/
    to create a jquery modal dialog, this is the code I added in html header :
    <link rel="stylesheet" href = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/
    redmond/jquery-ui.css" type="text/css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"> </script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"> </script>
    <script type="text/javascript">
    $( function() {
       $('#ModalForm').dialog(
            modal : true ,
            autoOpen : false ,
            width : 425,
            closeText : 'Close',
            stack : false,
            resizable : false,
            buttons  : {
                Cancel : function() {
                         closeForm();
                Save : function() {
                    updateMEMOVELD();
    function openForm()
        $('#ModalForm').dialog('open');
    function closeForm()
        //$('#ModalForm input[type="textarea"]').val('');
        $('#ModalForm').dialog('close');
    function updateMEMOVELD ()
       var get = new htmldb_Get(null, &APP_ID.,   
                        'APPLICATION_PROCESS=f_memo', 0);
       get.add('P9_MEMOVELD',$v('P9_MEMOVELD'));
       var gReturn= get.get();
       //alert(gReturn);
       //alert($v('P9_DATUM'));
      $s('P9_MEMOVELD',gReturn);
      alert($v('P9_MEMOVELD'));
      $s('P9_MEMOVELD_COPY',$v('P9_MEMOVELD')); 
      $('#ModalForm').dialog('close');
    </script>my situation is a little different, my modal does not have to perform an sql update, just change a field
    the user will then save in the main form
    for some reason the field never gets updated in the db
    I even created a on demand application process called f_memo :
    BEGIN
      APEX_UTIL.SET_SESSION_STATE('P9_MEMOVELD',:P9_MEMOVELD);
      htp.p(:P9_MEMOVELD);
    END;why is my field not send to the db ?
    it works when I delete this from the region header :
    < d i v id="ModalForm" title="Add Person" style=" d isplay:n one  "   >but then of course I no longer have a modal dialog
    what's wrong ?
    I put the code online at apex.oracle.com
    workspace XONIXRS
    login/password demo/demorun the application
    click on lijst facturen (invoices) (in the right sidebar region)
    then click on the zoeken (search) button
    a report appears, click on edit on the first line (200900017)
    now a form appears, click on the outright button memo
    now the modal shows up, change the field and click on save
    click on ok (for the alert) and then click on Save invoice
    you will remain on the same page
    now click on annuleren
    and then click on edit on the first line (200900017) again
    then click on memo again, you will see the memo has not been changed
    how comes ?
    Kr
    Martin

    The issue is that creating a modal of a region lifts that region from the HTML. Just have a look at the DOM when you run your page and not the source html, because that does not reflect changes to the dom made on page load. This means that your memo-field is removed from the FORM-tags, and effectively won't submit to session state. The item is not processed when you submit the page! You can track that through debugging your page. Memo is not saved and not processed.
    Trying to save the value to session state is not enough, it doesn't really matter in this case. The moment you submit the page, the session state will get overwritten by the submitted values of the items.
    So what i did:
    <ul>
    <li>move P9_MEMOVELD to region FACTUUR, together with all the other db fields</li>
    <li>change the type to hidden</li>
    <li>set value protected to NO</li>
    <li>in the modal region create a new page item P9_MEMOVELD_POP, type textfield</li>
    <li>set the source to always use a page item as source, with source P9_MEMOVELD</li>
    <li>changed function updatememoveld:
    function updateMEMOVELD ()
       var get = new htmldb_Get(null, &APP_ID.,   
                        'APPLICATION_PROCESS=f_memo', 0);
       get.add('P9_MEMOVELD',$v('P9_MEMOVELD'));
       var gReturn= get.get();
       //alert(gReturn);
       //alert($v('P9_DATUM'));
      $s('P9_MEMOVELD',gReturn);
      alert($v('P9_MEMOVELD'));
      $s('P9_MEMOVELD_COPY',$v('P9_MEMOVELD')); 
      $s('P9_MEMOVELD',$v('P9_MEMOVELD_POP'));
      $('#ModalForm').dialog('close');
    }Whether you want or need the session state set is up to you, it depends on if you use this somewhere else dynamically on the page and thus would influence results there, but i don't think it will (it's a memo field...)</li>
    </ul>
    Extra remarks:
    <ul>
    <li>be careful with including jquery libraries! The standard libraries are included, yet you add previous versions too! (1.4.2) This might lead to issues...</li>
    <li>use your templates better. Why would you wrap a region in div tags? Change or add a region template to be div tags. You can then easily assign a static id to this region, and target it. This will save you from wrapping wrapped wrappers (cause that is what the generated code looks like in the end).</li>
    </ul>

  • ActiveX controls disappear when VI is loaded in a Sub-Panel with Start Modal Dialog usage

    Hi,
    I have a subpanel in a VI (VI1) in which another VI (VI2) is loaded. VI1 is used as a module for an Action step in TestStand. VI2 has ActiveX controls like ExpressionEdit and Adobe PDF reader etc. VI1 loads VI2 in a sub-panel and calls Start Modal Dialog.vi. I have set 'Show front panel when called' to true for VI1 so that the VI pops up when the sequence is run. When the sequence runs and when the Start Modal Dialog VI is called from VI1, all ActiveX controls in VI2 (loaded in the sub-panel) disappears. Here is the screenshot of the frontpanel of VI1 when the sequence is run:
    This problem occurs in TestStand 4.2.1, TestStand 2010 and TestStand 2010 SP1 (as far as I have tested. May occur in older versions too). In the attached file, VI1 is 'ExprEdit Test.vi' and VI2 is 'SubpanelLoad.vi'. The attached sequence is developed in TestStand 2010 SP1.
    How can this issue be solved?
    Thank you,
    Ganesh Kumar
    Solved!
    Go to Solution.
    Attachments:
    Subpanel Load ExpressionEdit problem.zip ‏23 KB

    Hi,
    An update on this issue: I tried changing the order of loading the VI in the SubPanel and the start modal dialog. I called start modal dialog and then loaded the VI (VI2) in the SubPanel. When I ran the sequence, the activeX controls did not disappear (I was pretty sure that the ActiveX controls in VI2 would not disappear since I am calling Start Modal Dialog before loading the VI in the Subpanel). Then I just changed the sequence of operations back to the previous order (loading the Subpanel with the VI and then calling the Start Modal Dialog). When I ran the sequence, the activeX controls where still displayed. But when I ran the sequence with the VI1 backup (that I had taken before making all these modifications) the activeX controls were not displayed. I a nutshell, I now have 2 versions whose codes are the same. But when I run the sequence with action steps for these VIs, the activeX controls disappear when the unmodified backup VI runs and does not disappear when the modified VI is run. I have attached the files that I used along with the sequence file. The details are as follows:
    ExprEdit Test (Not Working).vi - The unmodified backup VI for which the ActiveX controls disappear.
    ExprEdit Test (Working).vi - The modified VIs in which the ActiveX Controls do not disappear (But same code as ExprEdit Test (Not Working).vi).
    ExpreEdit Test.seq - The sequence file containing 2 action steps one each for theabove mentioned VIs.
    SubpanelLoad.vi - The VI that contains activeX controls and is loaded in the SubPanel.
    Note that the sequence is created in TestStand 4.2.1.
    Thank you,
    Ganesh Kumar
    Attachments:
    Subpanel Load ExpressionEdit problem.zip ‏36 KB

  • Open Modal Dialog on Page Load of MOSS 2010

    Hi All
    We are trying to open modal dialog when home page opens on Sharepoint portal 2010
    We followed these steps:
    1. Created Page
    2. Created HTML Form Editor web part
    3. Added following code to its source
    <script type="text/javascript" language="javascript">
    Alert('Shahab');
    _spBodyOnLoadFunctionNames.push("HideNewIcons");
    function HideNewIcons(){
      var options=SP.UI.$create_DialogOptions();
    options.url='http://servername/sites/itd/SitePages/Test.aspx?IsDlg=1';
    options.height = 400;void(SP.UI.ModalDialog.showModalDialog(options))
    _spBodyOnLoadFunctionNames.push("HideNewIcons");
    </script>
    4. Neither ALERT nor MODAL DIALOG appear.
    We are on MOSS 2012. I checked the net and found there might be some issues in 2010. However, it works best on 2007
    Is there any other solution?
    Regards
    SSA

    Hi ,
    I understand that you want to open a modal dialog on page load in SharePoint 2010. The code Ashish provided works great. But you need to put the code on the page directly by editing the page in SharePoint designer(When putting the code in Content Editor
    Web Part ,the modal dialog doesn’t pop up correctly).
    Edit the page in SharePoint designer in Advanced Mode.
    Browse to the bottom of the code view .
    Add the code before the </asp:Content> tab.
    <script language="javascript" type="text/javascript">
            ExecuteOrDelayUntilScriptLoaded(yourFunction, 'SP.js');
            function yourFunction() {
                var options = { url:
    '/_layouts/viewlsts.aspx', title: 'Title, Description, and Icon', width: 640, height: 400 };
                 SP.UI.ModalDialog.showModalDialog(options);
             _spBodyOnLoadFunctionNames.push("yourFunction()");
    </script>
    Thanks,
    Entan Ming
    Entan Ming
    TechNet Community Support

  • Unable to close Modal dialog box

    Hello Friends,
    I am displaying a list in a Modal Dialog box. When I try to close the Modal dialog box. It is not getting closed.I have defined a gui status for this modal dialog box. PBO and PAI Coding is given below .
    module STATUS_0300 output.
      SET PF-STATUS 'STATUS_300'.
    SUPPRESS DIALOG.
      LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0 .
      IF p_week IS NOT INITIAL.
        WRITE : text-009 COLOR 1.
      ENDIF.
      IF p_month IS NOT INITIAL.
        WRITE : text-010 COLOR 1.
      ENDIF.
      LOOP AT g_t_wkmon_error INTO g_s_wkmon_error.
        WRITE :/ g_s_wkmon_error-matnr,
                 g_s_wkmon_error-period,
                 g_s_wkmon_error-quantity.
      ENDLOOP.
    LEAVE SCREEN.
    endmodule.  
    module USER_COMMAND_0300 input.
    CASE ok_code.
      WHEN 'OK'.
       LEAVE PROGRAM.
    ENDCASE.
    endmodule. 
    Thanks in Advance.
    Hari

    Hi,
    Check the below thread
    Re: Unable to close modal dialog box
    " Make sure you select the Radio Button DIalog BOX Typ while creating the Status in PBO
    You can use SET SCREEN 0 In the above Thread
    MODULE user_command_0100 INPUT.
      CASE ok.
        when 'CANCEL'. " You Standard GUI options shown in The GUI Screen
          SET SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    module STATUS_0100 output.
    SET PF-STATUS 'ABC'. " This is of type Dailog Box type
    *  SET TITLEBAR 'xxx'.
    endmodule.                 " STATUS_0100  OUTPUT
    Hope this would resolve your Issue.
    Cheerz
    Ram
    Edited by: Ramchander Krishnamraju on Apr 16, 2010 1:16 PM

  • Modal dialog not poping out of web page (ie 10 local settings?)

    I have an application that uses modal dialogs. These work on other computers in IE 10 and they will work on my Laptop windows 7 in firefox. The popup does not popup in IE10 on my windows 7 laptop (same one where firefox works fine).
    The code therefore appears not to be the problem but rather some local setting on my laptop. I have pasted a graphic to illustrate how the dialog window ends up in the same webpage below the initial web page.
    Any help with this issue would really be well received.
    Regards.

    Thanks I will give them a try, but have been told it may be better to try a jquery forum first thanks again.

  • Screen sequence processing when using modal dialog box

    I have been struggling with a dialog program which I have written.  I have a screen which has 2 radiobuttons and a check box (screen 100).  If the checkbox is marked, a modal dialog screen pops up (screen  150).  If I complete both input fields on  screen 150, I can go through to screen 200, then back out of screen 200 to screen 100, and then I can back out 100 to screen 0.
    The problem I have is the validation I have put in screen 150 if one or both input fields have no values or if I want to exit screen 150.  If I exit screen 150, in order to get back to screen 100 in the main screen I need to do CALL SCREEN 100 as if I use SET SCREEN 100, 100 then appears in my modal dialog box screen.
    If I try to back out of screen 100 to screen 0, the program then brings up screen 150 in the PAI part of the module and then go to screen 0 when I close screen 150 even though I have coded SET SCREEN 0. LEAVE SCREEN. in the user command module of screen 100.  Here is my code:
    <u><b>screen 100</b></u>
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
    PROCESS AFTER INPUT.
      MODULE user_command_0100.
    <b>
    <u>Modules for 100</u></b>
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'ZL_PWB_GR1'.
      SET TITLEBAR  'ZL_PWB_GR1'.
      CLEAR: w_hse_stock, w_new_product, wa_sto, w_reverse,
             mara-matnr,  mkpf-mblnr.
      PERFORM release_lock.
      REFRESH CONTROL 'TC_GR' FROM SCREEN 0200.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT .
      CASE ok_code.
        WHEN 'ENTER'.
          IF w_reverse = space.
            CALL SCREEN 0200.
          ELSE.
            CALL SCREEN 0150 STARTING AT 30 2
                             ENDING AT   75 5.
          ENDIF.
        WHEN 'BACK' OR 'EXIT' OR 'CANC'.
          w_pai = c_yes.
          SET SCREEN 0.
          LEAVE SCREEN.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    <u><b>screen 150</b></u>
    PROCESS BEFORE OUTPUT.
      MODULE status_0150.
    PROCESS AFTER INPUT.
      MODULE exit_command_0150 AT EXIT-COMMAND.
      FIELD  mara-matnr MODULE check_matnr.
      FIELD  mkpf-mblnr MODULE check_art_doc.
    <u><b>Modules for 150</b></u>
      MODULE user_command_0150.
    *&      Module  STATUS_0150  OUTPUT
    *       text
    MODULE status_0150 OUTPUT.
      SET PF-STATUS 'GR_REV'.
      SET TITLEBAR 'GR_REV'.
    ENDMODULE.                 " STATUS_0150  OUTPUT
    *&      Module  exit_COMMAND_0150  INPUT
    *       text
    MODULE exit_command_0150 INPUT.
      IF sy-ucomm = 'EXIT'.
        CALL SCREEN 100.
      ENDIF.
    ENDMODULE.                 " exit_COMMAND_0150  INPUT
    *&      Module  check_matnr  INPUT
    *  Check if issues has been filled and if issue is a valid article no.
    MODULE check_matnr INPUT.
      DATA: l_matnr TYPE matnr.
      IF mara-matnr IS INITIAL.
        MESSAGE i010(ad) WITH 'Issue no. required'.
        EXIT.
      ELSE.
        SELECT SINGLE matnr FROM mara INTO l_matnr
         WHERE matnr = mara-matnr.
        IF sy-subrc NE 0.
          CLEAR l_matnr.
          MESSAGE i010(ad) WITH 'Issue does not exist'.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " check_matnr  INPUT
    *&      Module  check_art_doc  INPUT
    *       text
    MODULE check_art_doc INPUT.
      IF mkpf-mblnr IS INITIAL.
        MESSAGE i010(ad) WITH 'Article document no. required'.
        EXIT.
      ELSE.
        PERFORM get_art_doc USING mara-matnr
                                  mkpf-mblnr.
        IF sy-subrc NE 0.
          MESSAGE i010(ad) WITH 'No article document exists for this issue'.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " check_art_doc  INPUT
    *&      Module  USER_COMMAND_0150  INPUT
    *       text
    MODULE user_command_0150 INPUT.
      CASE sy-ucomm.
        WHEN 'ENTE'.
          IF mara-matnr NE space AND mkpf-mblnr NE space.
            CALL SCREEN 200.
          ELSE.
    *        MESSAGE i010(ad) WITH 'Please fill in both fields'.
            SET SCREEN 150.
          ENDIF.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0150  INPUT
    Any suggestions or pointers would be greatly appreciated as I am going round in circles.
    Thanks
    Larissa

    Have got around this by removing the references to SET SCREEN 150.  This way, I can get around the screen sequencing.  It just means that I cannot keep my screen 150 in view if a validation message occurs but for now it will do for what I need.
    Thank you for your help anyway.
    Larissa

  • Make modal dialog box "Always on Top"

    i know there has been discussion about Frame always on top etc. but i have a slightly different problem.
    I have a Modal Dialog box which goes to the background when the parent window loses focus and gains it back.
    i am working on java version1.4. So the new methof in 1.5 version is of no use. Also i am working on Windows XP SP1.
    Do i have to make the dialogbox extend OptionPane instead of JDialo, which i am doing rt now?
    but OptionPane comes with a baggage and unnecessary code which i have to implement etc.
    Is there any easier way to solve this issue.
    Thanks
    PM

    This solution works for me under J2SDK v1.4.2_03. If you were to use it on a large scale, you'd probably want to develop a bit more of a formalized framework for it.
            final JFrame test_frame = new JFrame("Test");
            test_frame.getContentPane().setLayout(new BoxLayout(test_frame.getContentPane(), BoxLayout.Y_AXIS));
            JPanel panel = new JPanel(new FlowLayout());
            test_frame.getContentPane().add(panel);
            final JDialog[] modal_dialog = new JDialog[]{null};
            final JDialog d = new JDialog(test_frame, "Bah", true);
            JButton close = new JButton("Close");
            d.getContentPane().add(close);
            close.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    d.setVisible(false);
                    modal_dialog[0] = null;
            FocusListener fl = new FocusAdapter()
                public void focusGained(FocusEvent e)
                    if (modal_dialog[0]!=null)
                        modal_dialog[0].requestFocus();
            test_frame.addFocusListener(fl);
            JButton open = new JButton("Open");
            panel.add(open);
            open.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    modal_dialog[0] = d;
                    d.pack();
                    d.setLocationRelativeTo(test_frame);
                    d.setVisible(true);
            test_frame.pack();
            test_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            AWTUtilities.centerWindow(test_frame, null);
            test_frame.setVisible(true);

  • Cannot handle the request because a modal dialog or alert is active in indesign CS6, C#

    Hello,
    I'm having bunch of indesign CS6 files. I have written piece of code in C# which opens indesign files & exports those files to xml & pdf. If I run the exe, it works properly. But when I schedule it via task scheduler (runs at point of time without
    human intervention), it throws an error "Cannot handle the request because a modal dialog or alert is active" which results in failure of my process. This error keeps me annoying. So how to over come this error?
    Any help would be grateful. Thanks in advance.

    Hello,
    Thank you for your post.
    But your issue is out of support range of VS General Question forum which mainly discusses the usage issue of Visual Studio IDE such as
    WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Because your issue is involved to InDesign CS6 which is third-party, we don’t support it, so I will move it to Off-topic forum.
    Thanks,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Bug: Behaves like a modal dialog is open, but I don't see any?!

    I wonder if anyone else has come across this bug with SQLDeveloper. Sometimes when I'm working (it doesnt' seem to be at a specific time) the UI becomes unresponsive to mouse clicks. Everywhere I click results in a windows "bong" noise as though a modal dialog is open and preventing me from interacting with the main window, yet the main window is responsive to keyboard input, and I can use keyboard shortcuts to navigate the menus.
    Oddly enough, if I use keyboard to open a dialog e.g. Alt+H.. About, then I can interact with the dialog using the mouse. Similarly if I press Alt+H to pop open the Help menu (for example) and then click anywhere in the window (including the menu items) then the menu will disappear in response to the click.. But the "bong" is still heard and the UI doesnt respond to whatever was clicked on
    The only solution I have is to save all work and restart the app. Is it a known issue?
    Update: I carried on working with the app using only the keyboard. Some time has passed, and I've switched windows, edited code, copied and pasted stuff and saved. The UI is now again responding to mouse clicks without needing restarting.
    Regards
    cj

    I know what causes that - there's an API in the IDE called "WaitCursor" that blocks interaction with the UI while an operation is happening in the background. It's usually employed in cases where an operation is short enough not to require a progress dialog, but long enough that if it just happened on the UI thread, it would look like the product hung for a few seconds. What you're observing (keyboard keeps working, but mouse just produces beeps) is consistent with the behavior of this API. Something in SQL Developer or the base IDE probably forgot to, or took a very long time to, hide the wait cursor after a background operation.
    Summary: it's probably a bug. A Ctrl+Break thread dump not long after you see it happening would probably help the devs to figure out what's causing it.
    Thanks,
    Brian

  • VI does not float if called while modal dialog is running

    In my program I have Floating VIs that popup if certain conditions are met. These Floating VIs allow the Main VI to continue running, but remain front most so the user knows there is an issue.
    There are also other modal dialogs in the application that could be active when an Floating VI is called in the background. When the Floating VI is called it properly shows up behind the modal dialog and in front of the Main VI.
    The problem is that when the modal dialog is dismissed the Floating VI is no longer floating and appears behind the Main VI. Switching focus between VI's will bring either VI to the front. Changing focus to Windows Explorer (clicking on desktop) then back to LabVIEW restores floating behavior to the Floating VI.
    I've attached a crude example that exhibits this behavior.
    LV 2014 32-bit
    WIndows 7 64-bit
    Attachments:
    HiddenFloatingExample.vi ‏10 KB
    FloatingVI.vi ‏7 KB

    I can't offer a solution, but I can verify that the interaction between floating windows and modal dialogs is "hinky" -- though I haven't noticed the effect that you mention.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Executing bridgetalk messages from a modal dialog

    I have a script that runs a BridgeTalkLongProcess from an onClick event within a modal dialog. This worked well in CS2, but not in CS3. The BridgeTalkLongProcess does run, but not until the modal dialog closes. The BridgeTalkLongProcess is attempting to run a process in Photoshop (the target)from Bridge.
    Any tips on how to work around this. Do I have to convert the dialog to a palette? Why the change from the CS2 behavior?
    TIA
    Rory

    Rory,
    I had some more time to investigate this issue today, looking for the underlying bug.
    I now think my first advice (to use a scheduled task) was probably unhelpful--sorry. I have observed the following behavior sending BridgeTalk messages from button onSelect handlers in modal dialogs. If the onSelect handler sends the BridgeTalk message to Photoshop, the message is sent immediatelyy, but the BridgeTalk object's onResult handler is not called until the modal dialog box closes. If the onSelect handler schedules a task to send the BridgeTalk message, then the message is not sent until the dialog box closes.
    I am actually not very familiar with the AdobeLibraryN.jsx scripts, but I took a quick look at the BridgeTalkLongProcess class in the AdobeLibrary1.jsx that was in your zip and it looks to me like it may rely on getting a call to the onResult handler to work as designed. That may be why your script appears to hang--we're waiting on onResult, and that does not execute until the dialog closes.
    For now I reccomend that you try a work-around that will dismiss the modal dialog before you make any BridgeTalk calls to Photoshop.
    Thanks,
    David Franzen
    Quality Engineer
    Adobe Systems, Inc.

Maybe you are looking for

  • Firefox 35.0 update loses Windows desktop and user profile

    Recently updated Adobe Reader and Flash player and Firefox to 35.0 on Windows 8.1 Dell laptop. This resulted in the administrator user profile failing. Windows Event Log has: Windows cannot find the local profile and is logging you on with a temporar

  • Need a Algorithm for Getting the border of a shape

    I have a problem...I want a pseudocode..for the following problem Aim: I need the lines to be ordered first and then also it should be in anticlockwise directions (if the points are also not ordered for these ordered lines ..order them too... in anti

  • How to make a 'select .... where id in VARRAY' ?

    Hi all, Someone knows how to create a select using a varray? Like this: declare type arrayNumber is varray(20) of number; lista arrayNumber; v number; begin lista := arrayNumber(1,2,3); select 1 into v from dual where 1 in lista; end; If some one cou

  • How to compare two Universes of two different Datamarts?

    Post Author: Shrikant CA Forum: Integrated Solutions Hi.. all I want to compare two universes of different data mart to check the table structure. Can anybody please tell me how to compare two Universes of different Datamarts?How i can achive this us

  • Bridge CS6 starts Bridge CS4

    Having installed Bridge CS6, when I try to run it, I get Bridge CS4. Help, and thanks!