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

Similar Messages

  • How to display an error message on screen?

    Hi experts,
    In screen painter, how to display an error message in the message area just below the screen?
    Thanks!

    hi wuyia,.
    Write like this;
    Message 'Process completed Successfuly' TYPE 'S'.
    Message 'Want to Overwrite Value' TYPE 'W'.
    Message 'Press enter to continue' TYPE 'I'.
    Message 'Invalid Input' TYPE 'E'.
    S - Success
    W - Warning
    I - Information
    E - Error
    You can adjust your GUI option to display the message in a Popup or in the status bar.
    Regards
    Karthik D

  • How to display an error message after validation in Formatted Search?

    Hi SBO experts,
    if an error is detected on validation in a Formatted Search, how to display an error message to the user entering the data?
    Thanks & Regards,
    Raghu Iyer

    i created a formatted search query & attached it to the field 'Quantity' at Line Item level in Sales Order screen. just for testing purpose, i eneterd the following code lines in the query validating 'Quantity'
    if $[$38.11.0] > 50
    begin
    select @error = 1
    select @error_message = 'Vendor code cannot begin to X sign.'
    end
    the system throws the error : Internal error (8180) occurred [Message 131-183]
    actually, i need to display an error message to the user if Quantity is not in multiples of the OITM.SalFactor2
    if $[$38.11.0] % (SELECT T0.[SalFactor2] FROM OITM T0 WHERE T0.[ItemCode]  = $[$38.1.0]) > 0
    begin
    select @error = 1
    select @error_message = 'Error in Quantity.'
    end
    but, this expression to get the remainder itself seems to have some error
    $[$38.11.0] % (SELECT T0.[SalFactor2] FROM OITM T0 WHERE T0.[ItemCode]  = $[$38.1.0])
    i guess, % operator is used for modulo (to find the remainder of one number divided by another.) ? am i right ?
    Regards,
    Raghu Iyer

  • How to display an error message in maintenace view

    Hi,
    I have following requirement.
    I have a table. In the table, there is a field named REPORT which keeps an executable report name. When adding an entry i need to fill the field with an report name, which should exist in the system. The report name should not be include objects.
    Then I use search help HELP_TRDIR with import parameter SUBC = 1.  I also create a maintenance view for the table.
    Then my question is how to display a warning message if the report I input in REPORT field doesn't exist in the system. If I need to modify the generated objects of the maintenance view, how to do it.
    The reason i don't use foreign key is that it seems filter functionality is not availabe in the case with import parameter SUBC = 1.
    Thanks in advance,
    Best Regards, Johnney.

    Hi,
    You need to add your validation in the table maintenance events:
    Use the event : 01 - Before saving data to the databse table... for this purpose
    1) Go to Menu-> Utilities->Table mainatenace generator
    2) On the table maintenance screen->Menu->Enviroement-> Modifications->Events
    3) select an event 01 and give some subroutine/form name.
    4) Add your validation in the form(Note this form should be in the Func Group of the table maintanance genetaor)
    Regarrds
    Shiva

  • How to display the eror message in the iView

    Hi
    I want to check the user input in the client side and display an error message in the iView instead of displaying the error message as an alert
    it is ok when I tried to do it as an alert
    alert('ERROR MESSAGE');
    but the problem is how to display the error message as a text in the iView ...
    I wrote the below code..
    any one can see it and has any sugestion?
    Thanks
    =============
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <%
    String compid = "";
    String message = "";
    %>
    <hbj:content id="MyContent">
    <hbj:page title = "Selection Screen">
    <hbj:form id = "myForm">
    <br>
    <br>
    <br>
    <center>
    <H3>Benefits Statement </H3>
    <H4>Selection Screen</H4>
    <hbj:gridLayout
    id="FSSLayout"
    debugMode="False"
    width="40%"
    cellSpacing="5"
    >
    <hbj:gridLayoutCell
    rowIndex="1"
    columnIndex="1"
    width="10%"
    horizontalAlignment="LEFT"
    style="WildStyle"
    >
    <hbj:label
    id="label_inputPernr"
    required="TRUE"
    text="Personal Number:"
    design="LABEL"
    labelFor="inputPernr"
    />
    </hbj:gridLayoutCell>
    <hbj:gridLayoutCell
    rowIndex="1"
    columnIndex="2"
    width="40%"
    horizontalAlignment="LEFT"
    >
    <hbj:inputField id = "inputPernr"
    >
    <%
    compid=MyContent.getParamIdForComponent(inputPernr);
    %>
    </hbj:inputField>
    </hbj:gridLayoutCell>
    <hbj:gridLayoutCell
    rowIndex="10"
    columnIndex="1"
    width="40%"
    horizontalAlignment="CENTER"
    colSpan="2"
    >
    <hbj:button id = "myButton" text="Submit.." design="EMPHASIZED"
    tooltip="Click me to submit this form" onClick="ClickEvent" onClientClick="validRequired()">
    </hbj:button>
    </hbj:gridLayoutCell>
    </hbj:gridLayout>
    </center>
    <p font="Arial" size=20><%= message%></p>
    </hbj:form>
    <SCRIPT LANGUAGE="Javascript">
    function validRequired()
    var myvar = document.getElementById('<%=compid%>').value;
    var ivID='<%=componentRequest.getComponentContext().getContextName()%>';
    if (myvar = " ")
    message = "Enter Employee Number";
    ivuRefresh(ivID);
    htmlbevent.cancelSubmit=true;
    </SCRIPT>
    </hbj:page>
    </hbj:content>

    No problem, here is an example of some html code and javascript that you can adapt to your needs. You can display this standalone to see how it works.
    I hope this helps
    <html>
         <head>
              <script language="JavaScript">
                   function validateForm(){
                        if(document.getElementById("nameField").value == "")
                             document.getElementById("errormessage").innerHTML = "Please enter the Name";
                        else if(document.getElementById("ageField").value == "")
                             document.getElementById("errormessage").innerHTML = "Please enter the Age";
                        else if(document.getElementById("idField").value == "")
                             document.getElementById("errormessage").innerHTML = "Please enter the id";                         
                        else
                             document.getElementById("errormessage").innerHTML = "";
              </script>
         </head>
         <body>
              <table border="0" cellpadding="0" cellspacing="0">
                   <tr>
                     <td>Name</td>
                     <td><input type="input" id="nameField" name="nameField"></td>
                   </tr>
                   <tr>
                     <td>Age</td>
                     <td><input type="input" id="ageField" name="ageField"></td>
                   </tr>
                   <tr>
                     <td>Id</td>
                     <td><input type="input" id="idField" name="idField"></td>
                   </tr>
                   <tr><td><font color="red"><span id="errormessage"></span></font></td></tr>
                   <tr><td><input type="button" name="validate" onClick="validateForm()" value="Click to validate"/></td></tr>
              </table>
         </body>
    </html>

  • How to make reason code compulsory while processing F-53

    Hi Boss,
    Can u plz. tell me How to make reason code compulsory while processing F-53. this is because I have defined differnet reason code and one is having blank text.
    Thanks
    S

    hi,
    Just check this one dont check previous one....
    goto TCODE OBC4 and then click on ur company FELD status variant and double click on field status group ....
    Then click on G067 RECONCILTION ACCOUNTS and then double clickn that in that and then click on payment transactions and then select REASON CODE AS REQUIRED.
    ur problem will solve...
    if useful assign points
    regards,
    santosh kumar

  • In sales stage combobox how to display the step of the process coach

    On the business talk page, in sales stage combobox how to display the step of the process coach and can be selected, not only sale stage?
    thank you.

    For example, in salesprocess list, there are SystemSaleProcess, RenewalSalesProcess and DefaultSalesProcess.
    And SystemSaleProcess includes grasp of the situation, the first proposal, estimate submitting, the second proposal 4 salesstages.
    And grasp of the situation, including needs confirmation, background of the case confirmed, current problem confirmation, schedule and estimate confirmations, current system configuration confirmation 5 steps.
    Now in deal page, the deal type selected SystemSaleProcess, the salesstage is grasp of the situation, the first proposal, estimate submitting, the second proposal 4 salesstage can be selected in the salesstage drop-down box.
    But if want to choose more than salesstage, would like to choose needs confirmation, background of the case confirmed, current problem confirmation, schedule and estimate confirmations, current system configuration confirmation 5 steps in the salesstage drop-down box, then how to do it?
    thank you.

  • Mod_hlshttp [500]: Invalid timestamp found in the message while processing /hls-live/streams/rd-mp4

    Hi,
    We use  FMS 4.5.1 for streaming MP4 (H264/AAC) live streams to flash clients and iPads. Occassionally iPad viewers get error messages indicating that the video cannot be played. On these occasions we see error messages like this in our Apache logs:
    mod_hlshttp [500]: Invalid timestamp found in the message while processing /hls-live/streams/rd-mp4/events/noordoostpolder_1/liveevent/livestreamNum4390.ts
    Strangely enough this error message cannot be found anywhere in Adobe's documentation or anywhere else on the net (or perhaps I haven't searched well enough...)
    Has anyone else here encountered this problem and/or does anyone have an idea as to what causes these messages and this problem?
    Message was edited by: GRO-NIC: Does anyone have any idea? And/or can someone from Adobe respond? We are still receiving complaints from several of our customers about this.

    Hi,
    We use  FMS 4.5.1 for streaming MP4 (H264/AAC) live streams to flash clients and iPads. Occassionally iPad viewers get error messages indicating that the video cannot be played. On these occasions we see error messages like this in our Apache logs:
    mod_hlshttp [500]: Invalid timestamp found in the message while processing /hls-live/streams/rd-mp4/events/noordoostpolder_1/liveevent/livestreamNum4390.ts
    Strangely enough this error message cannot be found anywhere in Adobe's documentation or anywhere else on the net (or perhaps I haven't searched well enough...)
    Has anyone else here encountered this problem and/or does anyone have an idea as to what causes these messages and this problem?
    Message was edited by: GRO-NIC: Does anyone have any idea? And/or can someone from Adobe respond? We are still receiving complaints from several of our customers about this.

  • How to display a user message on WEBI Home page ?

    Hi all,
    How to display a user message on WEBI Home page ?
    like when ever the data gets scheduled at etl side i want to display a message a message on info view home page "new data is uploading" is this is possible to do ?

    Unfortunately this is not possible to do "out of the box".  There aren't any pre-configured options that will let you do this.  You're only real option is to try and modify the infoview source code yourself to do this.
    Regards,
    Shawn

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

  • ICI - How to display custom error messages in SAP CRM

    Hello,
    we are working on a custom Contact Center which interfaces with SAP CRM Version 7 with Enhancement Package over ICI.
    The basic call functions like accepting, hanging up, holding and retrieving are fully implemented and are working already.
    Our goal is to display error messages in the CRM so that clients know there is something wrong, for example why he can't be log in successfully (e.g. the telephony server isn't reachable).
    We already found the ICI Documentation file which provides us the CRM SOAP error codes and tried to send SOAP Fault messages, but never got
    them to screen.
    Please find an attached example screenshot what we mean exactly, reproduced by trying to make a call with CRM user while BCM CDT isn't
    running in the background.
    Regarding to this topic we've the following questions:
    - Is it possible to display custom error messages on the CRM or is this functionality limited to SAP?
    - Could you provide us some further information on how to use this feature exactly (implementation details?) and how the SOAP XML should look like to get it work?
    Thank you in advance!
    Best regards
    René Holy

    NewUser7 wrote:
    Please correct me if I am wrong
    I need to create an entity adapter and attach an error handler with the adapter? or can i handle that in the event handler itself. I coulnt find any api for handling errorsYou can do it both ways but since we are talking about event handler now, then in 9.x you need to extend com.thortech.xl.client.events.tcBaseEvent class for creating a event handler. In tcBaseEvent class there are various flavors of handleError method. So use that as per my note earlier and you should be good.
    HTH

  • How to display the Output messages on LabVIEW

    Hi,
    I'm building a simple user interface on LabVIEW and I have the following question:
     - TestStand has an Output Tab where I display some messages using Engine.OutputMessage; How can I do the same thing on my UI?
    I've attached a printscreen of my TestStand sequence as an example of what I want do do on LabVIEW.
    I apreciate all the help.
    Thanks in advance.
    Regards,
    Daniel Coelho
    Daniel Coelho
    VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
    Controlar - Electronica Industrial e Sistemas, Lda
    Attachments:
    TS PrintScreen.JPG ‏137 KB

    Sorry, from your post in the LabVIEW board I did not understand that it was the Output message that you were looking for.
    I thought you wanted the results from your test steps displayed on the user interface. 
    It is the “Output Panel” in the sequence editor that displays your output message, but I do not know if there is default Output panel activeX indicator for user interface that the TestStand engine would update automatically like it does the execution view.
    Maybe someone else knows 
    As also pointed out, the UI messages is your other option.
    The Output Message event number is 40 
    http://zone.ni.com/devzone/cda/epd/p/id/3879
    UIMsg_OutputMessages–(Value: 40) TestStand sends this message at periodic intervals when it holds references to output messages that calls to the OutputMessage.Post method queue. TestStand transfers the queued messages to an OutputMessages collection attached to the UIMessage.ActiveXData property for this event. An application that processes output messages should copy the output message references from the collection in UIMessage.ActiveXData to its own private OutputMessages collection by passing its private collection to the OutputMessages.CopyMessagesToCollection method. An application calls the Engine.NewOutputMessages method to create a private OutputMessage collection. TestStand generates this event only if the Engine.OutputMessagesEnabled property is True. Because there can be more than one handler for this event, the application should not modify the OutputMessages collection the UIMessage.ActiveXData property holds.
    Omar
    Message Edited by OmarGator on 10-09-2008 10:12 AM

  • How to display long error message in ME21N

    Hi,
    How to display a long error text (in multiple lines) in ME21N / ME22N message popup we get while saving or checking the PO. My error message length is 100 chars. It is displaying only 40 chars in a single line. My requirement is to display that in multiple lines of message popup. Please let me know asap.
    Thnks in Advance.

    Hi,
    Messages have long texts.... Uncheck the self-explanatory box, change your long message to a short one, place your long message in the long text of your message. SAP should handle the rest.
    Reward if helpfull...
    Cheers,
    Ameen.

  • How to display an alert message on click of link in tableview

    Hi,
    Following is the code for a tableview in layout section of a BSP( i have specified only one tableview column here). The requirement is to display an alert message on click of link in the first column that is "evbeg". Can anyone please help me how to achieve this? Appreciate quick response on this.
    CREATE OBJECT lr_dateiterator TYPE cl_lso_bsp_it_trdates
                EXPORTING im_application = application
                im_tform = trainingform.
            <htmlb:tableView id            = "dates"
                                 table         = "<%= dates %>"
                                 iterator      = "<%= lr_dateiterator %>"
                                 width         = "100%"
                                 rowCount      = "<%= lp_len %>"
                                 footerVisible = "FALSE"
                                 sort          = "SERVER" >
                  <htmlb:tableViewColumn columnName    = "evbeg"
                                         type          = "user"
                                         title         = "<%= otr(LSO_FRONTEND/schedule) %>"
                                         tooltipHeader = "<%= otr(LSO_FRONTEND/schedule) %>"
                                         sort          = "TRUE" >
                  </htmlb:tableViewColum>
    Thanks and Regards,
    Archana.

    you have to code in the iterator for this.
    in the render_cellstart method of the iterator you need to code.
    this is for a column.
    when 'MATNR'.
    data: text type string.
    text = 'disp_alert()'.   "this java script i placed in the page
    data: lo_link type ref to cl_htmlb_link.
      create object lo_link.
         lo_link->id = p_cell_id.
         lo_link->onclientclick = text.
         lo_link->text = <fs>-matnr.
         p_replacement_bee = lo_link.
    below is the java script i added in my page..
    <  sc ri   pt type="text/javasc ript"   >
    f u n  ction disp_alert()
    a  l e  rt("helloworld");
    < /s  c ript >

  • How to display only one message in WD

    Hi all,
    I want to display successful message or error message when certain action is perform.
    I have my message enter in the MessagePool, say Request_Successful_Updated and value is "your request is successfully updated"
    In my WD, I do this:
    IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
    IWDTextAccessor textAccessor = wdComponentAPI.getTextAccessor();
    msgMgr.reportSuccess(textAccessor.getText(IMessage<my class>.Request__Successful__Update));
    The error message appear three times in the top view, right side view and the bottom of the view.
    How to just displayed one error message on just on side of the view?

    Hi
    Define a success message or Error message in the pool.
    Use the following statement
                   wdComponentAPI.getMessageManager().reportMessage(IMessage<Comp_Name>.<MessageKey>,
                        null,false);
    Define message areas  View element in your View and place it where you want to display the error message.
    May be this helps you.
    Regards
    Kalyan

Maybe you are looking for

  • How to batch upload PDF files into database BLOB

    Hello. I have a requirement to batch upload PDF files into BLOB column of an Oracle 8.1.7 table from Forms 6i Web. The content of the blob column (ie. the PDF content) MUST be displayable from all client software (eg. Oracle Web forms, HTML forms, et

  • Problem in displaying image on jsp page

    I want to display an image on jsp page.I copied the image the image in WebContent folder. I am able to see the image on the design pane when using the following code:- <img src="/image.gif" height="50" width="50"> but when i run it in the browser not

  • Creating Macros in MS word from ABAP

    How to create a macro in MS word from ABAP code.I want to generate tables dynamically in Word using Macro from the data generated by the code. Regards, Sinu.

  • Report Problems with nvl...

    Hi, I have a problem with a report in my application. On the page, there are two items, a submit button and a report. I intend to use this to search the report for the two attributs, which are in the items. The report should show the result, even if

  • Placing meta tags possible in iWeb?

    If you are publishing your website to a host other than .Mac - is one able to place in meta tags for each page? And If so...how? Is one able to place in a hit counter? And if so...how? Thanks, Neal