Hi Brian,

Make use of the ULCPollingTimer to start the long-running task.

In the action of the button, change labels, display the wait dialog / frame
and start a polling timer.

In the action of the polling timer start the long running task and when the
task ends close the frame with wait message.

Your code does not work because everything is being executed on the server
and the client is not synchronised until the processing of the request
(button action) is complete.

 I hope this helps.

Thanks and regards,

Janak
  -----Original Message-----
  From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of McCarty, Brian
  Sent: Wednesday, May 16, 2007 7:44 PM
  To: [email protected]
  Subject: [ULC-developer] long-running task


  I have a long-running task that retrieves data by calling a RPG program on
an IBM AS400 through the server.  This task is initiated by a button click.
When the button is clicked I would like to change the text of some ULCLabels
on the current screen and also display a new ULCFrame with a wait message.
With the code below the labels are not changed and the frame not displayed
until after the long-running task has completed.



  How can I force the display to change on the client before the
long-running task begins?

  Thanks,

  Brian



  btnExport.addActionListener(new
com.ulcjava.base.application.event.IActionListener() {

     public void
actionPerformed(com.ulcjava.base.application.event.ActionEvent e) {

        ULCFrame waitMsg = new ULCFrame("Please Wait");

        waitMsg.setBounds(100, 100, 300, 200);

        waitMsg.setVisible(true);



        labelCurrentASN.setText("");

        labelASNDate.setText("");

        labelASNDescription.setText("");



        UserSpaceExport asnExport = new UserSpaceExport(appVars);

        asnExport.setStrRFMLrec("asnRec");

        asnExport.setStrCriteria(getStrCriteria(true));

        String id = DownloadManager.INSTANCE.put(asnExport);

        try {

           DownloadManager.INSTANCE.showDocument(id, "template");

        }

        catch(IOException ioe){

           new ULCAlert("Error Message - FinInqAsnLkup","Cannot open
spreadsheet: " + ioe,"OK").show();

        }

     }

  });


Reply via email to