/ Forums / Advansys Formativ / Creating Solutions with Formativ / Formativ 2.0 – Applet Chaining

  • Creator
    Topic
  • #4085
    Anonymous

      Here’s the scenario:

      I have an Applet that fires on the Send event and executes a control dialog. When a user clicks a button on this dialog, it launches a third party Shell application object. This application retrieves a string from the user and copies it to the clipboard. When the application exits, the Applet auto-pastes it from the clipboard.

      Here’s the problem:

      The Applet dialog window hides itself when the shell application is launched and it doesn’t return until the application exits. However, users who tab back to the message view while the application is still running are able to click SEND, which results in GW freezing (the Applet is still waiting for the application to close before it can continue running the script).

      OPTION 1: How can I keep the applet dialog window from hiding whenever the shell application is launched? If I launch the shell asynchronously, I can still see the applet window, but then the auto-paste feature doesn’t work because the Applet pastes from the clipboard before the application has a chance to copy to it.

      OPTION 2: Can I launch the shell from a second Applet chained to the first one? And can I do this asynchronously from a button-click, so that I can see both Applet views? This would indirectly prevent users from tabbing back to the message view clicking SEND.

      Note: Having the users manually paste the string from the clipboard is not an option.

      Any ideas on how I can make this work?

    • Author
      Replies
    • #7055
      Support 1a
      Participant

        I assume you are using Formativ 2.0, given you mention Applet chaining.

        This is a difficult question to answer without seeing your applet code, and knowing details of the third party application. Using version 2.0, I suspect the answer probably lies in a mechanism whereby the applet watches the the third party applications window (using FindWindow), and sits a loop while the application is still running, ensuring it remains in the forground for the duration.

        Anothet option could involve modifying the third party application (if possible) to locate and hide the GroupWise email view window for the duration so that the user cannot tab back to it. If you can’t change the third party application, you could write a small ‘stub’ application that the applet shells. (instead of the third party app). This stub application then locates and hides the email view window, then shell the third party application. (I am using the term ‘hide’ here in a general sense – you may need to locate the ‘send’ button on the form and temporarily disable it, for example).

        This is a tricky problem to solve, but it should be doable. The complexity lies in the fact that three processes are involved that require synchronization from a Windows focus (and process) perspective. A little trickery is often required to work around this type of problem.

        I hope this helps.

        Advansys Support

      Viewing 1 replies (of 1 total)
      • You must be logged in to reply to this topic.