Launching JavaHelp with a modal dialog

Hi,
I am trying to launch JavaHelp from a modal dialog, which consists of a JTabbedPane with 2 tabs. My code right now checks to see which index is selected, then sets the help ID accordingly. However, when I run my application, JavaHelp simply does not launch. How do I work around the problem with the modal dialog...the code for checking the index is correct, because it works in another part of the application, only that window is not modal.

hi there
you can try with       helpButton = new JButton("Help");
      CSH.setHelpIDString(helpButton, helpTopicId);
      if(myHelpBroker != null) {
        helpButton.addActionListener(
            new CSH.DisplayHelpFromSource(myHelpBroker);
      } supposed you initialize myHelpBroker with something meaningful (a valid help broker pointing to the help set in question) and helpTopicId with the id of the topic to be displayed
HTH
Ulrich

Similar Messages

  • JavaHelp, Frames and Modal Dialogs...recommendations

    Seen a few posts on this, but no answers.
    I've got help buttons scattered throughout my application for users to get context sensitive help.
    Here's the behavior I'm seeing:
    Scenario 1:
    - Initiate JavaHelp from a Frame
    - Bring up a modal dialog
    - JavaHelp is blocked
    - Click on a help button in my dialog
    - A new JavaHelp window appears
    - Close the dialog
    - The new JavaHelp window disappears
    - The original JavaHelp window is now blank
    - When I try to destroy the original JavaHelp window, a NullPointerException is thrown from the windowClosing method
    Scenario 2:
    - Initiate JavaHelp from a modal dialog
    - Close the dialog
    - JavaHelp disappears
    I really want JavaHelp to work like help in other applications:
    - I want one window to come up and work regardless of dialogs opening and closing
    - I want the user to use the JavaHelp while performing a task
    Is there a solution to this?

    Is SE 6 the only solution?
    Anyone know what the version of Java currently shipping with Mac OS X will support?

  • 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

  • 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

  • SBO running in TSRemoteApp crashes when clicking on Modal dialog box

    We have a customer who has installed SAP Business One 8.81.316 PL08 on Windows Server 2008 R2.  The application is accessed by users using RemoteApp.  The application generally runs well, however, when a user is presented with a Modal dialog box (i.e. Do you really want to delete Y/N) and clicks on the dialog box, the foreground RemoteApp session crashes.  If the user then reconnects to the back end session, the application is exactly as it should be, with the dialog box still displayed.
    When connecting by a normal RDP type session, the problem isn't evident.
    Has anyone experienced this behaviour? 

    I realize this is a very old topic, but I've run into the same problem.
    I can't get PrimeFaces modal dialog to work in Internet Explorer 7 using JSF2/facelets/PrimeFaces 2.0.2.
    So I am looking for alternatives, but have not found anything so far.
    Any hints?
    Edited by: burferd on Jun 21, 2010 7:56 PM

  • Trying to make up a Modal Dialog with customized event dispatcher

    Hello everyone.
    I try to make up a ModalDialog class with customized event dispatcher in order to wait an invoker.
    But it fails :-(
    import javafx.event.ActionEvent;
    import javafx.event.Event;
    import javafx.event.EventDispatchChain;
    import javafx.event.EventHandler;
    import javafx.event.EventTarget;
    import javafx.event.EventType;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.layout.BorderPane;
    import javafx.scene.layout.HBox;
    import javafx.stage.Modality;
    import javafx.stage.Stage;
    import javafx.stage.StageStyle;
    import javafx.stage.Window;
    import javafx.stage.WindowEvent;
    import com.sun.javafx.stage.WindowEventDispatcher;
    import java.util.ArrayList;
    public class ModalDialog extends Stage {
      ArrayList<Button> buttons;
      int rc;
      Stage stage;
      Event event;
      EventDispatchChain tail;
      public ModalDialog( Window owner, String title ){
        initModality( Modality.APPLICATION_MODAL );
        initOwner( owner );
        initStyle( StageStyle.UTILITY );
        setTitle( title );
        stage = this;
      public void setContents( Group group, ArrayList<Button> buttons ){
        BorderPane root = new BorderPane();
        Scene scene = new Scene(root);
        setScene(scene);
        root.setCenter( group );
        this.buttons = buttons;
        HBox buttonPane = new HBox();
        buttonPane.setSpacing(10);
        for( int i=0 ; i<buttons.size() ; i++ ){
          buttons.get(i).setOnAction( actionHandler );
        buttonPane.getChildren().setAll( buttons );
        root.setBottom( buttonPane );
      public int show( double screenX, double screenY ){
        setX( screenX ); setY( screenY );
        show();
        MyWindowEventDispatcher dispatcher =  new MyWindowEventDispatcher( stage );
        setEventDispatcher( dispatcher );
        while(true){
          event = dispatcher.dispatchEvent( event, tail );
          EventType<? extends Event> type = event.getEventType();
          if( type==WindowEvent.WINDOW_HIDDEN ){
            break;
        return( rc );
      EventHandler<ActionEvent> actionHandler = new EventHandler<ActionEvent>() {
        public void handle( ActionEvent e ){
          EventTarget src = e.getTarget();
          rc = buttons.indexOf( src );
          stage.hide();
      class MyWindowEventDispatcher extends WindowEventDispatcher {
        public MyWindowEventDispatcher( Window window ){
          super( window );
        public Event dispatchEvent( Event event, EventDispatchChain tail) {
          ModalDialog.this.event = dispatchCapturingEvent( event );
          ModalDialog.this.tail = tail;
          return( event );
    }A sample code to invoke ModalDialog
    import java.util.ArrayList;
    import javax.swing.JOptionPane;
    import javafx.application.Application;
    import javafx.event.EventHandler;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.Label;
    import javafx.stage.Stage;
    import javafx.stage.WindowEvent;
    public class WindowEvent06 extends Application {
      Stage mainStage;
      public void start(Stage stage) throws Exception {
        Group root = new Group();
        Scene scene = new Scene(root);
        stage.setScene(scene);
        stage.setTitle("WindowEvent06");
        mainStage = stage;
        stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
          public void handle(WindowEvent e){
            ModalDialog dialog = new ModalDialog( mainStage, "Question" );
            Button yes = new Button( "Yes" );
            Button no  = new Button( "No" );
            ArrayList<Button> buttons = new ArrayList<>();
            buttons.add(yes); buttons.add(no);
            Label msg = new Label( "Really Exit ?" );
            Group groupInDialog = new Group();
            groupInDialog.getChildren().add( msg );
            dialog.setContents( groupInDialog, buttons );
            int ans = dialog.show( 300, 300 );
            System.out.println("returned from a modal dialog");
            if( ans == 1 ){
              e.consume(); // this blocks window closing
        stage.show();
      public static void main(String[] args) {
        launch(args);
    }

    Hi,
    The logic what you follows is some what in the right direction but need to have some changes.
    What I would say is, first consume the windowClose event. Then open the dialog box and close the parent accordingly.
    So after refactoring your code.
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.Label;
    import javafx.scene.layout.BorderPane;
    import javafx.scene.layout.HBox;
    import javafx.stage.Modality;
    import javafx.stage.Stage;
    import javafx.stage.StageStyle;
    public class ModalDialog extends Stage {
         Stage owner;
         Stage stage;
         BorderPane root;
      public ModalDialog( Stage owner, String title){
        root = new BorderPane();
        stage = this;
        this.owner = owner;
        initModality( Modality.APPLICATION_MODAL );
        initOwner( owner );
        initStyle( StageStyle.UTILITY );
        setTitle( title );
        setContents();
      public void setContents(){
        Scene scene = new Scene(root,150,150);
        setScene(scene);
        Group groupInDialog = new Group();
        groupInDialog.getChildren().add( new Label("Really Exit ?") );
        root.setCenter( groupInDialog );
        Button yes = new Button( "Yes" );
        yes.setOnAction(new EventHandler<ActionEvent>() {
              @Override
              public void handle(ActionEvent paramT) {
                   stage.close(); // Closing the pop up.
                   owner.close(); // Closing the parent stage also.
        Button no  = new Button( "No" );
        no.setOnAction(new EventHandler<ActionEvent>() {
              @Override
              public void handle(ActionEvent paramT) {
                   stage.close(); // Closing the pop up only
        HBox buttonPane = new HBox();
        buttonPane.setSpacing(10);
        buttonPane.getChildren().addAll(yes,no);
        root.setBottom(buttonPane);
        stage.show();
    }And the main class to check this implementation is
    import javafx.application.Application;
    import javafx.event.EventHandler;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.stage.Stage;
    import javafx.stage.WindowEvent;
    public class WindowEvent06 extends Application {
      public void start(final Stage stage) throws Exception {
        Group root = new Group();
        Scene scene = new Scene(root);
        stage.setScene(scene);
        stage.setTitle("WindowEvent06");
        stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
          public void handle(final WindowEvent e){
             e.consume(); // Consuming the event by default.
             new ModalDialog( stage, "Question");
        stage.show();
      public static void main(String[] args) {
        launch(args);
    }I hope the above code will give you some idea what i mean. :)
    Happy Coding !!
    Regards,
    Sai Pradeep Dandem.
    Edited by: Sai Pradeep Dandem on Jan 20, 2012 4:03 AM

  • Java help dialog invoked from modal dialog with webstart

    Hi,
    we have an application where we invoke a Help window from a modal dialog. It works fine if ran from IDE but doesn't work if ran from a webstart loader. The problem is to be able to set decorations (exit/minimize) for this help window but since this window is null (from printouts) it never goes to lines where decorations are set. The help dialog is displayed by calling super.setDisplayed(true) but it is not setting variables "frame" or "dialog" of DefaultHelpBroker class.
    I am sure it doesn't sound very clear but if you had a similar problem with web start messing up something please let me know.
    thanks.
    private static void initHelp()
        ClassLoader loader = HelpFactory.class.getClassLoader();
        try
          URL url = HelpSet.findHelpSet(loader, HELPSETNAME);
          helpSet = new HelpSet(loader, url);
          helpBroker = new DefaultHelpBroker(helpSet)
            public void setActivationWindow(Window window)
              if (window instanceof Dialog)
                Dialog d = (Dialog) window;
                if (d.isModal())
                  super.setActivationWindow(window);
                  return;
              super.setActivationWindow(null);
            public void setDisplayed(boolean b)
              //no exception here and shows dialog with no decorations
              super.setDisplayed(b);
              System.out.println("d: " + dialog);//prints null here
              System.out.println("d: " + frame); //prints null here
              if (b)
                if (dialog != null)//since this is true, it never sets decorations
                  dialog.hide();             
                  dialog.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
                  dialog.show();
          helpBroker.setFont(new Font("Verdana", Font.PLAIN, 12));
          helpListener = new HelpListener(helpBroker);
        catch (HelpSetException e)
          e.printStackTrace();
      }

    sorry guys, i should've posted it either in the web-start or on javahelp forums. I'll do it right now.
    never mind :-)

  • Module Pool - Error message on a Modal Dialog screen with input

    Hello All,
    I have a modal dialog screen which is called on F4 help of a input field. This dialog screen has radio buttons on it to select. On selection, we check if the user is authorized to that option. If not, raise and error message with command MESSAGE msgid.....
    When the error message pops-up and when clicked ok on it, the radio buttons on the modal dialog screen gets disabled. I want to have the modal dialog box to be able to accept the new radio button as input.
    Can anyone please suggest.
    Thanks,
    Smita

    Put all of your Radio buttons in the CHAIN ... ENDCHAIN with one module.
    CHAIN.
        FIELD rb1.
        FIELD rb2.
        FIELD rb3.
        MODULE check_chain ON CHAIN-REQUEST.   "<< implement logic in check_Chain
      ENDCHAIN.
    If you want, you can even disable the options before displaying the screen. Do all necessary checks in the PBO and based on that disable the options.
    Regards,
    Naimesh Patel

  • Problem with non modal ADM dialog

    I have problem with focus and mouse and keyboard event passing to non modal dialog if some modal window was opened and closed on Windows platform.
    I have this problem in my plugin, but also I did some tests with SDK WordFinder Plugin.There are 2 dialogs open there : CountDialog-non modal dialog and PromtDialog-modal one. I commented all lines in function DeleteCountDialog to leave this dialog on the screen. So, first, when "create page map" menu is selected, CountDialog is appearing and stays on the screen. At this stage, it can be moved and get focus when is clicked.After that, I click on "find word by word offset" and then PromtDialog is appearing. when I close Promtdialog by clicking on OK or Cancel, CountDialog is "freezing" - means, it can not be moved and does not get focus when I click on it.
    Is it known problem ? Is there is some workaround there ?
    thanks in advance,
    Lidia.

    Thanks a lot for your response.
    I did changes as you recommended, but still have the same result.
    So I have WordFinder from Acrobat SDK 8 with only one file changed:WordFinderDlg.cpp - see below.The result is the same:
    1. I open Acrobat->Open some file
    2. Click on "Advanced->Acrobat SDK->Word Finder->create Page Map" menu
    3. "count" non Modal Dialog is opened and working and then stays on the screen and can be moved without problem.
    4. Now I click on "Advanced->Acrobat SDK->Word Finder->find Word By Offset" - Modal Promt Dialog is opened. click some number and then click ok - choosen word is selected in Acrobat. From this moment, first "Count" dialog is frosen - can be selected, can not be moved.
    The only workaround I see here is to create non Modal dialog every time I close Modal one.
    Could you please advice ? May I please send to you project in zip ?
    I really need it ASAP ?
    thanks in advance,
    Lidia.
    ADOBE SYSTEMS INCORPORATED
    Copyright (C) 1994-2006 Adobe Systems Incorporated
    All rights reserved.
    NOTICE: Adobe permits you to use, modify, and distribute this file
    in accordance with the terms of the Adobe license agreement
    accompanying it. If you have received this file from a source other
    than Adobe, then your use, modification, or distribution of it
    requires the prior written permission of Adobe.
    \file WordFinderDlg.cpp
    - Implements a modeless progress dialog and a generic prompt dialog.
    // Acrobat headers
    #ifdef WIN_PLATFORM
    #include "PIHeaders.h"
    #endif
    #include "ADMAcroSDK.h"
    #include "resource.h"
    Constants/Declarations
    static ADMDialogRef countDialog;
    static AVWindow gAVWindow = NULL;
    // Global variables used for simplicity
    const ASInt32 MaxLen = 80;
    static char textStr[MaxLen];
    static char titleStr[MaxLen];
    static char msgStr[MaxLen];
    Modeless Progress Dialog
    /* UpdateCountDialog
    ** Updates the dialog with a new GUI function to show count number
    void UpdateCountDialog(ASInt32 cnt)
    ADMItemRef itemRef;
    itemRef = sADMDialog->GetItem(countDialog, IDC_COUNT);
    sADMItem->SetIntValue(itemRef, cnt);
    sADMDialog->Update(countDialog);
    /* CreateCountDialog
    /** GUI function to delete the count dialog
    void DeleteCountDialog(void)
    // destroy dialog
    /*if (countDialog) {
    sADMDialog->Destroy(countDialog);
    countDialog = NULL;
    // Release ADM
    ADMUtils::ReleaseADM();*/
    /* SettingsCountDialogOnInit
    ** Called to initialize the the dialog controls
    ASErr ASAPI CountDialogOnInit(ADMDialogRef dialogRef)
    ADMItemRef itemRef;
    itemRef = sADMDialog->GetItem(dialogRef, IDC_COUNT);
    sADMItem->SetUnits(itemRef, kADMNoUnits);
    sADMItem->SetIntValue(itemRef, 0);
    return kSPNoError;
    /* CreateCountDialog
    ** Creates the modeless dialog.
    void CreateCountDialog(void)
    // Initialize ADM.
    ADMUtils::InitializeADM();
    // Display modeless dialog.
    countDialog = sADMDialog->Create(sADMPluginRef, "ADBE:Wordfinder", IDD_COUNT_DIALOG,
    kADMNoCloseFloatingDialogStyle, CountDialogOnInit, NULL, NULL);
    Generic Prompt Dialog
    /* PromptOnOK
    ** Called when the user clicks OK. Stores the string entered by the
    ** user.
    static void ASAPI PromptOnOK(ADMItemRef item, ADMNotifierRef inNotifier )
    sADMItem->DefaultNotify(item, inNotifier);
    // get user input string
    ADMDialogRef dialog = sADMItem->GetDialog(item);
    ADMItemRef item1 = sADMDialog->GetItem(dialog, ID_PROMPT_FIELD);
    sADMItem->GetText(item1, textStr, MaxLen);
    sADMDialog->EndModal(dialog,IDOK,FALSE);
    AVAppEndModal();
    AVWindowDestroy(gAVWindow);
    /* PromptDialogOnInit
    ** Called to initialize the dialog controls.
    ASErr ASAPI PromptDialogOnInit(ADMDialogRef dialogRef)
    gAVWindow = AVWindowNewFromPlatformThing (AVWLmodal, AVWIN_WANTSKEY, NULL, gExtensionID, sADMDialog->GetWindowRef(dialogRef));
    AVAppBeginModal (gAVWindow);
    sADMDialog->SetText(dialogRef, titleStr);
    sADMDialog->SetDefaultItemID(dialogRef, IDOK);
    sADMDialog->SetCancelItemID(dialogRef, IDCANCEL);
    ADMItemRef itemRef;
    itemRef = sADMDialog->GetItem(dialogRef, IDOK);
    sADMItem->SetNotifyProc(itemRef, PromptOnOK);
    itemRef = sADMDialog->GetItem(dialogRef, ID_PROMPT_FIELD);
    sADMItem->SetUnits(itemRef, kADMNoUnits);
    sADMItem->SetMinIntValue(itemRef, 1);
    itemRef = sADMDialog->GetItem(dialogRef, ID_PROMPT_NAME);
    sADMItem->SetText(itemRef, msgStr);
    return kSPNoError;
    /* PromptForInfo
    /** Generic prompt dialog that gets a text string from the user.
    /** @return IDOK or IDCANCEL.
    ASInt32 PromptForInfo(const char *title, const char *msg, char *buf, ASInt32 bufLen)
    if (!buf || (bufLen == 0))
    ASRaise (GenError(genErrBadParm));
    // Initialize ADM.
    ADMUtils::InitializeADM();
    // init data
    buf[0] = 0;
    strncpy(titleStr, title, sizeof(titleStr) - 1);
    strncpy(msgStr, msg, sizeof(msgStr) - 1);
    // Dispaly modal dialog to get user input
    ASInt32 rc = sADMDialog->Modal(sADMPluginRef, "ADBE:Wordfinder", IDD_PROMPT_DIALOG,
    kADMModalDialogStyle, PromptDialogOnInit, NULL, NULL);
    // get user input data
    if (rc==IDOK)
    strcpy(buf, textStr);
    // Release ADM
    ADMUtils::ReleaseADM();
    return rc;

  • Plugin fails to display modal dialog with ActiveX'ed bean

    I have first posted this in the ActiveX bridge group, and have gotten no response. Since the plugin group also has posts on modal dialogs, thought this is also correct to post here. Both plugin and ActiveX'ed beans use beans.ocx for display.
    I have a bean wrapped as ActiveX with sun.beans.ole.Packager. The bean provides a method, which ultimately will pop up a modal confirm dialog (JOptionPane.showConfirmDialog(.)).
    If the method is triggered solely from within the bean, say via a click on a bean's button, all is well.
    If the method is triggered from its host (VB form), the
    - the call is done on the main thread. The confirm dialog shows, but when I click on one of its buttons, the app hangs.
    - If I try to pass the call into the event dispatch thread (SwingUtilities.invokeAndWait(.)), the confirm dialog somewhat pops up, but does not paint completely and the app hangs.
    - If I try to pass the call into the event dispatch thread with SwingUtilities.invokeLater(.) all is well, the confirm dialog pops up, I can click on its buttons, etc. but the function returns to VB too early, which is not what I want since I need the answer.
    - I have tried the following:
    entry method determines it is not on the event dispatch thread.
    Tries itself with invokeLater(.), yields the current thread and calls wait(.).
    The method invoked later will execute in the event dispatch thread, popup the confirm dialog and when finished will do a notifyAll(.).
    Unfortunately, what happens is that the entry thread (the main thread) puts the invokeLater into the event dispatch queue, yields itself and wait()'s. And waits and waits. In the meantime, the dispatch thread will get to the point where it wants to show the confirm dialog, but will then hang. If I time out the wait in the main thread, then the confirm dialog is popped up immediately after the wait finishes with the time-out.
    Sooo, this tells me that there is some strange synchronization going on which causes something like a deadlock. Is there any good approach to triggering modal dialogs from a native app hosting the ActiveX'ed bean??
    I have found many entries on probs with modal dialogs in the plug-in, which relate to applets. But no solution yet.
    Some keywords that I have came across are:
    - the event dispatch queue can be flushed and "empty events" can be posted into it. Also, the invokeAndWait(.) will register a "conditional" message pump on the event queue that seems to work until the locking condition is no longer valid. Any experience with these? Any way to manipulate (a) main thread, (b) event dispatch queue, (c) event dispatch thread to resolve the apparent deadlock?
    - There seems to be some difference in locking when the parent process is VB/COM as when it is Java. I have the impression that the main thread has some lock until the call made from VB/COM is fully completed and the call stack cleaned up. Can anyone confirm this? And/or suggest a way around it?
    Sylvia

    Sylvia - I found your posting because I have a similar problem in which a JavaBean wrapped using the Packager needs to call a Visual Basic event subroutine from a thread other than the main thread.
    This, I have discovered, is not supported in VB unless you use special thread marshalling calls (not available to the Java bean) or event queuing calls (ditto, afaik).
    My point is that this may be related to your problem. Check this Microsnot document on their public support site:
    Q196026

  • Please, help with simple modal progress dialog

    Progress dialog will create a reader thread and block user input to main form until read is completed. It will have only a number of bytes received text message and one cancel button. It will be closed when user presses the button or thread is done with reading.
    I understand the principles of IO and thread communication very well. I'm asking for modal dialog candidate. Should I override JDialog or it is possible to use JOptionPane or something else? The modal dialog should be able to register some listener to get progress messages from the reader thread.

    JOptionPane should be really easy way to go, since you can pass in an Object, and that object
    could be a JPanel containing your JProgressBar and any other components/layout you want.

  • Help with modal dialog returning a value to the calling page

    Greetings,
    Apex Version: 4.1.0.0.32
    What I am trying to do is to create a modal dialog that is called from a form page. The dialog will present the user with an IR report that will allow the him to select a row and return a value from that row to a field on the calling page. I have it working in Firefox, but I get an error using IE 8. I hope someone can show me why it is not working in IE.
    Here is how I am doing it:
    From the calling page:
    Created a button
         Action: Redirect to URL
         URL Target: javascript:var rc = window.showModalDialog('f?p=&APP_ID.:70:&SESSION.::&DEBUG.:::','','resizable:yes;center:yes;dialogWidth:1000px;dialogHeight:500px;');
    On the called page:
    The called page is an IR report where the query returns this as one of the columns:
    *(Note: I had to put a dot '.' in front of the onclick to get it to show in this thread. It is not there in my real code.)*
    select
    <a href="#" name="z" style="color:blue; text-decoration:underline;" .onclick="javascript:passBack(''' || LOT_NO ||''');">Select</a>' SelectThis
    , column1
    , column2
    from sometablename;This resolves the anchor to:
    <a .onclick="javascript:passBack('232158');"  href="#">Select</a>Here is the Javascript function that is called from the anchor onclick:
    function passBack(passVal1)
      opener.document.getElementById("P75_ITEM1").value = passVal1;
      close();
    }When I run this in Firefox, it works as expected. I click on the button on the parent page. The modal dialog is opened and the IR report is displayed. I click on one of the links in the report and it returns the correct value back to the calling page and closes the modal dialog.
    When I run it in IE8, it fails. I click on the button on the parent page. The modal dialog is opened and the IR report is displayed. I click on one of the links in the report and I get this error: “opener.document is null or not an object”.
    I hope that is clear and that someone can help.
    Thanks
    Larry

    A quick google search determines that window.opener doesn't exists when using window.showModalDialog
    Suggestions range from using window.open instead of window.showModalDialog to using dialogArguments instead of window.opener
    Try the following:
    In the parent page define a getPopupValue() function:
    function getPopupValue(){
       var dr =  window.showModalDialog('f?p=&APP_ID.:70:&SESSION.::&DEBUG.:::','','resizable:yes;center:yes;dialogWidth:1000px;dialogHeight:500px;');
        if ( (dr != undefined) && (dr != '') && (dr != false) ){
         $x("P75_ITEM1").value = dr;
    }Change the button url to call the function:
    javascript:getPopupValue(); On the popup page change the passback function to:
    function passBack(passVal1)
      returnValue = passVal1;
      close();
    }

  • How to create a modal dialog, which I can still interact with document when the dialog is show.

    HI,
        Now, I am developing an automation plugin, and want to create a modal dialog, which I still can interact with document when the dialog is show.
        I find photoshop has some modal dialog have this function, such as the dialog of Customize Proof Condition and the dialog of Color Settings. Are these dialogs not modal dialog?
         Thanks!

    The whole point of a modal dialog is that you cannot interact with other things while it is active.
    And Photoshop does not support plugins accessing the rest of Photoshop while any plugin UI is active.

  • Display a MFC Modal Dialog with CListBox in TestStand

    I want to display a MFC Modal Dialog with a CListBox element, but I can't fill the listbox with data.
    Here are some commands of my program:
    SequenceContext seqContext;
    Engine engine;
    seqContext.AttachDispatch(seqContextDisp, FALSE);
    engine.AttachDispatch(seqContext.GetEngine());
    HWND parentHwnd = (HWND)engine.GetAppMainHwnd();
    CSearch_Line_Window_Dialog dlg(CWnd::FromHandle(parentHwnd));
    dlg.m_SearchLineWindow_Listbox.m_hWnd = parentHwnd;
    (without this command I get the error "Debug Assertion Failed", because of ASSERT(::IsWindow(m_hWnd)))
    dlg.m_SearchLineWindow_Listbox.AddString("Hallo");
    dlg.DoModal();
    seqContext = NULL;
    engine = NULL;
    The dialog with the emtpy listbox appears, b
    ut without any text. I tried the same by using NotifyStartOfModalDialogEx and NotifyEndOfModalDialog. The example "MFC_Modal_Dialog" opens only a dialog without elements.
    I hope you can help me to solve my problem.
    Thank you.

    I've about the same problem and tried to implement your solution but can't get it to run. I always receive an assertion failure.
    I try to fill the ComboBox in a dialog with items at runtime. (use VC++ and MFC-DLL)
    the header of my dialog:
    class DlgSelectECU : public CDialog
    public:
    DlgSelectECU(CWnd* pParent = NULL);
    BOOL OnInitDialog();
    //{{AFX_DATA(DlgSelectECU)
    enum { IDD = IDD_DLGSELECTECU_DIALOG };
    CComboBox m_ECUList;
    CStringList m_StringList;
    //}}AFX_DATA
    //{{AFX_VIRTUAL(DlgSelectECU)
    protected:
    virtual void DoDataExchange(CDataExchange*pDX);
    //}}AFX_VIRTUAL
    protected:
    DECLARE_MESSAGE_MAP()
    the implementation of my dialog:
    DlgSelectECU:lgSelectECU(CWnd* pParent /*=NULL*/)
    : CDialog(DlgSelec
    tECU::IDD, pParent)
    //{{AFX_DATA_INIT(DlgSelectECU)
    //}}AFX_DATA_INIT
    BOOL DlgSelectECU:nInitDialog()
    POSITION pos = m_StringList.GetHeadPosition();
    while (pos)
    m_ECUList.AddString(m_StringList.GetNext(pos));
    return true;
    void DlgSelectECU:oDataExchange(CDataExchange* pDX)
    CDialog:oDataExchange(pDX);
    //{{AFX_DATA_MAP(DlgSelectECU)
    DDX_Control(pDX, IDC_COMBO_ECU, m_ECUList);
    //}}AFX_DATA_MAP
    my dll function TestStand calls looks like that:
    EXPORT CALLBACK SelectECU(char ECUs[1024])
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    DlgSelectECU Dlg;
    Dlg.m_StringList.AddTail("ITEM 1");
    if (Dlg.DoModal() == IDOK)
    // do something
    Running the sequence file in TestStand and calling the dll function descriped above causes an assertion failure each time I try to add anything to the StringList. Why? And what am I doing wrong? Is there
    a documentation about how to write dlls with MFC elements
    for use with TestStand using other tools than LabWindows/CVI? Everything I found so far is rather crude.
    Thanks!

  • How does EventQueue work with modal dialogs?

    Can anybody point me to some documentation/article/book etc. which thoroughly explains how exactly the EventQueue and EventThread work when a modal dialog is being opened? I assume dispatchEvent() for the event that opens a modal dialog does not return until the modal dialog is closed. If so, how are events handled while a modal dialog is open?
    I can't seem to find any book that goes into detail of these Swing/AWT internals.
    Thanks,
    -Martin Roth
    [email protected]

    The short answer is that a second event pump is created while the modal dialog is visible. The original event pump (which is different than an event thread) is indeed blocked until the dialog is closed. The code creating the new pump is in the java.awt.Dialog::show () method.
    The event pump is part of the java.awt.EventDispatchThread class.

Maybe you are looking for

  • Printing multi invoices from ebay works in IE8 but not Firefox, tried all your help tips, still not working?

    I sell things on ebay. I need to print out multi invoices from ebay. When I do this from Firefox the first page has my address but no customer info. It then prints out the second page OK. So I have to then return to printing out invoices and check (t

  • Will upgrading iTunes cause a problem for existing iPod?

    My wife has a nano that has been established on this PC and I just got a 30GB iPod video model that I want to put on this PC. iTunes said that my iPod cannot be recognized unless I upgrade our verion of iTunes. Will this harm the library that my wife

  • BI scheduler problem (AIX)

    hi! I've got a problem with configuring BI Scheduler. I followed the instructions, and it all seems fine, I can start the service, I can configure iBots, I can save them, they are in the database... but when I try to run one, it gives me this error m

  • SC 3.2: is Cacao needed to operate the cluster?

    Subject says pretty all - I am running SC 3.2u2 on a S10 u7 x86 system and just can't stand that CACAO java process. Can I disable Cacao? What is it used for in the cluster? TIA, Rick

  • Appraisal Document Sub_status in PHAP_ADMIN_PA

    We are using two substatuses in our appraisal template. When using transaction PHAP_ADMIN_PA to change the status on a document, no sub_statuses are displaying with the drop-down for selection. They are entered in table T77hap_sstatus, however there