Display a popup message while a loop is running

Can somebody give me some good ideas on how I could create a popup that will appear when a loop is running and then disappear when the loop is finished. I would also like to show a status bar in the popup.

Hi,
I'd make a sub vi with a case in it. The case has three 'states': Show
Window, Hide Window and NOP (no operation). The sub vi must be a dialog, but
Show window when opend must be off.
The Show Window and Hide Window case should have vi property nodes (no
reference wired, to use it's own reference) with the 'show panel' property
set to true and false. The NOP case is empty.
Wire an enumerated to the case, and wire it's control to the connector pane.
Also wire a status control to the connector pane.
Put the sub vi before the while loop, with the Show Window option. The sub
vi will show (perhaps you also want to initialise the status indicator in
the Show Window case).
In the loop, put the sub vi with the status control wired to the actual
value, and NOP to
the window control.
When done (after the while loop, but be carefull about race conditions, )
put the sub vi with Hide Window wired to it. (Put the enumerated inside the
while loop and wire it through the while loop to the sub vi to prevent
this.)
Regards,
Wiebe.
"Terry S" wrote in message
news:[email protected]..
> Can somebody give me some good ideas on how I could create a popup
> that will appear when a loop is running and then disappear when the
> loop is finished. I would also like to show a status bar in the
> popup.

Similar Messages

  • Is usng while(true) loop in run mthd of thread good idea 2 make it wait ind

    hi freinds.
    sorry for writing short forms in my subject, but what i want to know is that is is using while(true) loop in run method of thread good idea to make it wait indefinately.
    if not then what might be a good idea.
    I Just need to Start a thread and make it wait indefinitely,
    thanks

    No. "while (true) {}" is a horribly bad way to do
    nothing, as that thread will use 100% of the CPU.
    What does "wait indefinitely" mean? Surely it can't
    mean "wait forever", but if it doesn't mean that then
    I can't guess what it does mean. Do you want to wait
    until some condition is true? Or do you want to wait
    a random amount of time? More information would help.Hello Dr.Clap, read your comments then checked my task manager and found that indeed it occupies 100% of CPU usage. thats really horrible , even i dont want that . ok i will explain u what i am trying to do along with my program on how i have accomplished it . please correct me where i went wrong.
    My Requirement
    my Application is deployed on JBOSS which has its JMS. now lets say i have defined a Queue named "MyAppQueue" and i know that all the senders whereever they may be will post there messages on this queue.
    Now my responsibility is to write a MessageReceiver which is continously running and checking this queue for messages. whenever it receives a message it immidiately calls the messagesListener which processes the message.
    So sow my requirement of Writing such MessageReceiver is that , it should always be in running mode(that means once i start it, it starts forever since this is going to be a REal time application) and continously checking the queue, as soon as some message comes it calls messageListener. and also that this messageReceiver should be fast , i mean coz many messages may come at once say 40-50 messages in a minute.
    so please tell me how do i now write this MessageReceiver.
    the way i have written
    My Code
    package test.jms;
    import java.util.Properties;
    import javax.jms.JMSException;
    import javax.jms.Queue;
    import javax.jms.QueueConnection;
    import javax.jms.QueueConnectionFactory;
    import javax.jms.QueueReceiver;
    import javax.jms.QueueSession;
    import javax.jms.Session;
    import javax.jms.TextMessage;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class MyThreadReceiver implements Runnable{
        String queueName = null;
         Context jndiContext = null;
         QueueConnectionFactory queueConnectionFactory = null;
         QueueConnection queueConnection = null;
         QueueSession queueSession = null;
         Queue queue = null;
         QueueReceiver queueReceiver = null;
         TextMessage message = null;
         MyQueueListener myQueueListener = new MyQueueListener();
        /* (non-Javadoc)
         * @see java.lang.Runnable#run()
        String j;
        public void run() {
            // TODO Auto-generated method stub
            while(true){
               try {
               // Thread.sleep(10000);
            }catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
        public static void main(String[] args) {
            MyThreadReceiver myReceiver = new MyThreadReceiver();
            myReceiver.establishConnection();
          /* after connection is established to the queue, i am not closing the   connection.i am making a thread and passing my class object to it and in run method i have written while(true ) loop to somehow make my MessageReceiver program run indefinately.. */
            Thread thread = new Thread(myReceiver);
            thread.start();
            System.out.println("finished");
         this method opens connection to the queue. and i am not closing this connection .
        private void establishConnection(){
                 queueName = "queue/testQueue";
                      try {
                        Properties env = new Properties();
                        env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");
                        jndiContext = new InitialContext();
                   }catch (NamingException e) {
                        System.out.println("Could not create JNDI API " + "context: " + e.toString());
                        System.exit(1);
                   try {
                        queueConnectionFactory = (QueueConnectionFactory)jndiContext.lookup("QueueConnectionFactory");
                        queue = (Queue) jndiContext.lookup(queueName);
                   }catch (NamingException e) {
                        System.out.println("JNDI API lookup failed: " + e.toString());
                        System.exit(1);
                   try {
                        queueConnection = queueConnectionFactory.createQueueConnection();
                        queueSession =      queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
                        queueReceiver = queueSession.createReceiver(queue);
                        queueReceiver.setMessageListener(myQueueListener);
                        queueConnection.start();
                   } catch (JMSException e) {
                        System.out.println("Exception occurred: " +
                        e.toString());
                   } finally {
                        //if (queueConnection != null) {
                        //try {
                        //queueConnection.close();
                        //}catch (JMSException e) {}
       please correct my code. thanks in advance

  • How to display a modal message while processing in a thread.

    I have difficulty in display a modal dialog while in processing in a background.
    I have created the following class.
    package fedex.screen.component;
    import java.awt.*;
    // This infobox is a modal dialog which display static text and stay
    // on screen without blocking proceeding code from execution and can
    // only close by issuing close method.
    public class ProcessInfoBox implements Runnable
         // Display dialog box
         private InfoBox dialog = null;
         // Thread to enable showing of Dialog Box
         private Thread thread = new Thread(this);
         // Determine if to close dialogbox
         private boolean isFinish = false;
         public ProcessInfoBox(Frame frame) {
              dialog = new InfoBox(frame,"Performing Operation","Processing...");
    thread.setPriority(Thread.MAX_PRIORITY);
         public void setTitle(String title) {
              dialog.setTitle(title);
         public void setText(String text) {
              dialog.getMessageLbl().setText(text);
         // The reference return will be ProcessInfoBox.InfoBox
         public InfoBox getInfoBox() {
              return dialog;
         // Thread method
         public void run() {
              dialog.setVisible(true);
              // If true return from thread and exit.
              while ( isFinish == false )
                   try
                        Thread.sleep(500); // 500 msec
                   catch ( InterruptedException e )
         // Start showing dialog
         final public void show() {
              thread.start();
              isFinish = false;
         final public void hide() {
              isFinish = true;
              dialog.setVisible(false);
         // Dialog box which show text.
         public class InfoBox extends Dialog
              private Label messageLbl = new Label("Processing ...");
              public InfoBox(Frame frame, String title, String message) {
                   super(frame,title,true);
                   initInfoBox();
              public Label getMessageLbl() {
                   return messageLbl;
              private void initInfoBox() {
                   setLayout(new BorderLayout());
                   add(messageLbl,BorderLayout.CENTER);
                   setSize(250,150);
    FormUtility.centerForm(this);
         public static void main(String[] args) {
              Frame frame = new Frame("BigMac");
              frame.setSize(600,600);
              frame.setVisible(true);
              ProcessInfoBox box = new ProcessInfoBox(frame);
              box.show();
              for ( int i = 1; i < 10000; i++ )
                   System.out.println(i);
              box.hide();
    To test the code I used the following section to test
    The main method in the class is used. In the simple
    example, the message did correctly update itself while
    i is increment. However, when I try on more complex
    application, the message just stalk there without
    updating itself as it is hanging.
    I have try to set piority to highest but without effect.
    Is there anything to rectify the situation
    thank

    The "please wait" dialog is a modal dialog. When u
    show it, the following code can not executed!
    That's the problem

  • How to display a popup message in query (through process chain)

    Hi Gurus,
    I need your help.
    I have an input query that triggers an event (through a button) and runs a process chain.
    I would like to show a popup message to inform the user when the process chain is over.
    Using function modules I've been able to show popup messages in the workbench, but I want to display this message directly in Bex Analyzer 7.0.
    Thanks
    Gabbo

    Hi,
    I'm also looking for a solution to display a custom message in the Bex Analyser at logon.
    Using function module in the logon user-exit works but only when loggin to the workbench.
    I don't want to use SM02 (which works in both cases) because I need to display a variable message depending on the user.
    If someone has an idea, I'll really appreciate.
    Best regards and happy New Year to all of you.

  • To display a popup message alongwith ALV grid

    Hi Experts,
    I have a requirement where I need to display data using ALV Grid. Also, in case there are any errors encountered during the data extraction I need to inform the user about it by using either a popup message or a status message stating that he needs to check the error log. To display the error log I have provided a push button which will take the user to another screen where he can see all the errors encountered.
    Can anyone please let me know as to how to accomplish the task of displaying a status message alongwith a ALV grid display?
    Looking forward to your reply.
    -Warm regards,
    Prajakta K.

    use exception handling and pop up.........
    try following in grid..
    *--Exception handling
    ENDIF .
    ENDIF .
    WHEN 'EU' .
    READ TABLE gt_list INDEX ls_selected_row-row_id .
    IF sy-subrc = 0 .
    CALL FUNCTION 'ZPOPUP_CONV_CURR_AND_DISPLAY'
    EXPORTING monun = 'EU'
    quant = gt_list-paymentsum.
    ENDIF .
    ENDCASE .
    ENDFORM .

  • Problem while displaying popup message while using inputfile component

    Hi
    I am using JDEV 11.1.1.2.0, using ADF i developed and application
    in my page i have a input file component, from which i am taking a csv file and reading it through valuechangeevent of inputfile component. I have used myfaces.trinidad-UploadedFile to get the selected file and read it using inputstream.
    I have put some validation check (validation check is done while reading the file using valuechangeevent of the inputfile component), while reading the file and incase i receive any error (validation mismatch), the reading of file stops ... and before doing that i used to display error message using below method:-
    public String ValidationCheck(String attrname, String attrvalue, int rownumber) {
    String msg="Validation error found in "+attrname+" with value "+attrvalue+" of row "+rownumber+" in the file. Please correct the file and retry/";
    FacesContext ctx = getFacesContext();
    FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, "");
    ctx.addMessage(null,fm);
    return null;
    i have used the same method to display message in other places where its showing correctly but fails in inputfile component.
    Please help me out how can display messages from inputfile component??
    Thanks
    Sudeep
    Edited by: SKD on Feb 21, 2012 12:02 PM
    Edited by: SKD on Feb 21, 2012 4:08 PM
    Edited by: SKD on Feb 21, 2012 4:11 PM

    It works fine for me (albeit on 11.1.2.1). Here is my complete test case:
    FileUploadTest.jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <af:document title="FileUploadTest.jsf" id="d1">
        <af:form id="f1" usesUpload="true">
          <af:inputFile label="Label 1" id="if1" valueChangeListener="#{TestBean.vcl}"/>
          <af:commandButton text="commandButton 1" id="cb1"/>
        </af:form>
        <af:messages id="m1"/>
      </af:document>
    </f:view>TestBean.java:
    package view;
    import javax.faces.application.FacesMessage;
    import javax.faces.context.FacesContext;
    import javax.faces.event.ValueChangeEvent;
    import oracle.adf.share.logging.ADFLogger;
    public class TestBean
      private static final ADFLogger _LOG = ADFLogger.createADFLogger("view.TestBean");
      public TestBean()
      public void vcl(ValueChangeEvent valueChangeEvent)
        _LOG.severe("in the value change event");
        FacesContext ctx = FacesContext.getCurrentInstance();
        FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_ERROR, "This is a message", "Message");
        ctx.addMessage(null, fm);
    }adfc-config.xml:
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <managed-bean id="__1">
        <managed-bean-name>TestBean</managed-bean-name>
        <managed-bean-class>view.TestBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
    </adfc-config>John

  • Display Temporary wait message while host is processing

    Hi there,
    On my jsp, I'm calling stored procedure. That stored procedure would take enough time to execute and return resultset.
    Is it possible to display message on screen, while stored procedure is being executed at host? Also, this message should be displayed conditionally.
    Thanks in anticipation
    Edited by: google_me on Oct 23, 2009 4:03 AM

    Yes, you're guessing it right that I'm having hard time with Ajax. It seems like the control doesn't flow in linear order. :( .But now I can't go back. I think only the ajax function is what needs some adjustment
    Here is something I've put up with my little ajax knowledge (the ajax function which polls the progress of the update)
    function ajaxGetForamtStatus()
         var ClaimsKey = document.getElementById('ClaimsKey').value;
         var status = "Y";
         var responseData;
         while(status =="Y")
              var setProgressStatus = function(responseData)
                   if(responseData && responseData == "run")
                        status = "N";
              var ajax;
              if (window.XMLHttpRequest)
                   ajax=new XMLHttpRequest();
              else if (window.ActiveXObject)
                   ajax=new ActiveXObject("Microsoft.XMLHTTP");
              else
                   alert("Your browser does not support XMLHTTP!");
                   return;
              var url="../jsp/FormatStatus.jsp?ClaimsKey="+ClaimsKey;
              if(ajax.onreadystatechange)
                   status =  ajax.responseText
              ajax.open("GET",url,true);
         location.href =  '../jsp/DisplayResult.jsp?ClaimKey=' +ClaimKey + '&FirstTime=Y';
    }And here is the FormatStatus.jsp
    <jsp:useBean id="db" class="com.csc.pt.access.DbBean" scope="request" />
    <%@ page import="java.util.* "%>
    <%
    String usr = (String)session.getAttribute("User");
    String pwd = (String)session.getAttribute("Password");
    String env = (String)session.getAttribute("env")+"DAT";
    String ClaimsKey = request.getParameter("ClaimsKey");
    if(!db.isConnected())
         db.connect(usr,pwd, env);
    String returnValue="";
    String query = "Select 1 from BASPCL100 WHERE CLAIM = '"+ClaimsKey+"' FETCH FIRST 1 ROW ONLY";
    java.sql.ResultSet rs=db.execSQL(query);
    if(rs.next())
         returnValue = "wait";
    else
       returnValue = "run";
    if (db!=null) db.close();
    out.println(returnValue);
    %>As obvious, the ajax function gets caught in an infinite loop and the browser go to non-responding state.Please help me out.

  • Popup message while creating new CRM activities in the Portal

    Hello All,
        We are implementing EP 7.0 SPS 12 and have integrated CRM 5.0 with it. We have installed CRM BP 5.0 SPS 01.
    When we are creating activities through the Portal using the "Business Activity" iview and then save the creation, we get a popup with the message - <b>"The web page you are viewing is trying to close the window. Do you want to close this window?"</b>..
    What could be wrong and how should we solve this?
    Thanks.

    Hi Sunitha,
            I think that this kind of message will come because of the timeout property in the backend system(CRM).Try to figure out the timeout property in backend and increase the same.
    Regards,
    Vinoth.M

  • Display ("Please Wait") message WHILE the page loads

    Hello All,
    I have adf/jsf application. How to add message " Please Wait While Page Loads" WHILE+* the page is loading ?
    I am thinking of Window.confirm(" Please Wait While The Page Loads") Is there a better (More Modern) way to do this?_
    Many Thanks,

    John, when I type <af:statusIndicator and ctrl + space, JDev does not show statusIndicator as one of the choices. I tried adding code but it seems it does not recognize statusIndicator as one of the tags. I am using other jsf and adf tags on the same page :(
    Thanks,

  • Show message while the method is running

    Hello,
    I'm having a really good problem.
    I've a server method, that is taking a good time to run, so i thougth i could show a pop up message to warn the user that the method is running.
    But, i can't use it by tag.
    Is there a way of showing it by code, ie with and actionListener, or something else?
    Thanks!
    Fernando.

    Try using 'af:poll' component on your page.
    You can send events to the server at fixed intervals and then evaluate the status.
    You will probably have to do some more logic on the server side to make this work correctly though.
    Good luck!
    --AJ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Displaying messages while running BEx queries.

    Hi Experts,
    Can any one explain me is there any possibility to display some popup messages while running BEx queries?
    Regards,
    Anusha

    Hi there,
    You can do taht with user exit variables with the code something like this:
      WHEN 'YOUR_VARIABLE'.
        if i_step = 2.
        LOOP AT eto_charsel INTO ln_charsel.
    *some validation of your own
          if ln_charsel-low NE '1'.
    *call function to send a message, in this case, an error message
             CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
               EXPORTING
                 i_class  = 'ERROR!'
                 i_type   = 'E'
                 i_number = '000'
                 i_msgv1  = 'Please connect again and'
                 i_msgv2  = 'use the Revision Layout'.
                 RAISE no_processing.
          endif.
        ENDLOOP.
        endif.
    Diogo.

  • Display popup message on SRM portal

    Hi,
    I need to display a popup message on the SRM portal while doing a PO confirmation. Can you please guide me how to do it?
    Do I need to modify the templates or can it be done using a BADI?
    Thanks in advance.

    Hi,
    Try using CHANGE badi.
    See these related threads also for more pointers:
    Error in pop up (dialog box)
    Customized Pop-up window in Shopping Cart
    POPUP window in shopping cart during Order
    BR,
    Disha.

  • How to add Popup message as soon as user logins to portal system?

    Hi,
    I want to display a popup message as soon as user logs on to the portal system.
    Regards,
    Anagha

    Anagha Bhat wrote:
    what do you mean by  "iView with the popup as the entry point" ?
    I think this means, iView's 'Launch in new window' property should be accordingly set..

  • Popup message for down payment

    hi,
    regarding down payment, system will show the popup message while entering FB60 and MIRO, the same popup message is it possible to shown while doing F-53 & f-58 to vendor.
    govind.

    Hi
    Commitments warnings: Is the check box available in the Special G/L indicator config screen. If you select that check box then only the warning message apprears. Below given the help for the same -
    Indicator: Send Warning Message if Balance Exists ?
    Has the effect of sending a warning message if you post to an account for which a balance exists for the special G/L indicator.
    Message popouts at the time of invoicing and no possiblity at the time of payment. But, the system will take if you are making payments using the APP, that depends on the config.
    VVR

  • How do I show and hide a popup message by the program

    Hi,
    I've the following problem. Sometime the program must wait to open a seriel port. On slow machines, this could take some seconds.
    During this time I'll display a popup message with the message "please, be patient....".
    After the port is open, the message should be hide by the program.
    JOptionPane could be good, but without a "OK" button. Everthing should be controlled by the program.
    I would implement the Runnable interface for the showing of the popup message.
    Any ideas? Thanks in advance.
    Hans

    You can use a JDialog... this will act like JOptionPane, but you can put on it whatever components you like... so no OK button!
    For example:
    JDialog dialog = new JDialog(parentFrame);
    dialog.add(new JLabel("Please be patient", BorderLayout.CENTER);
    dialog.pack();
    dialog.setLocation(100,100);
    dialog.setVisible(true);
    dialog.setVisible(false);

Maybe you are looking for

  • I am moving into a hotel apartment that has wifi...what about connecting my TC?

    the wifi in the hotel apartment is secured with an ID and password for connecting. Will I be able to connect my TC to such network wirelessly, and then still have my devices connect to my TC and share the internet? (and the printer connected on my TC

  • Can I convert a from from Adobe Forms Central to a PDF Form?

    Can I convert a from from Adobe Forms Central to a PDF Form?

  • Problem using c:forEach

    I'm having a problem using c:forEach. Eclipse is telling me the problem is with the items parameter, and for the life of me, I cannot see why, since I could swear forEach uses an items parameter. Here is my code and the exception report. Can anyone p

  • How to embed html tags in out.println

    Hi, i have the following code in a function in java which passes the JspWriter object out.println("<table>");           out.println("<tr>");           out.println("<td>User Id</td>");           out.println("<td>Pack Purchased </td>");           out.p

  • Buffering problem on Apple TV

    On my iTouch, I have 3 exercise bike workouts.  All 3 play perfectly on my computer and my iTouch.  However, only 2 of them play all the way through on Apple TV.  The third one starts to play, and then every few minutes stops and starts buffering for