Jump to content

ProcessEventQueue(): Worker is not assigned


Roberto Nicchi

Recommended Posts

I have the exception "ProcessEventQueue(): Worker is not assigned." when the statement "UniSession.Synchronize" is executed in the code below.

Is my code wrong ?

thanks

 

procedure Tmyframe.create_report;

var
  dest:Tdest_report_frm;
begin
    dest:=Tdest_report_frm.Create(uniGUIApplication.UniApplication);

    dest.showmodal(procedure(sender:Tcomponent; res:integer)
                   begin
                     if res=mrOk then
                     begin
                       ShowMask('Please wait ...');
                       UniSession.Synchronize; <--- EXCEPTION HERE
                       try
                         CreateTheReport;
                       finally
                         HideMask;
                         UniSession.Synchronize;
                       end;
                     end;
                   end
                  );

Link to comment
Share on other sites

20 minutes ago, Roberto Nicchi said:

Ok, thanks.

Roberto

BUT :) if in the button that close the form i want a confirmation (see below), again there's the same problem. Is there a workaround for this ?

 

 

  if messagedlg('Confirm ?',mtConfirmation,[mbyes,mbno])=mrYes then
  begin

    ShowMask('Please wait ...');

    UniSession.Synchronize;


    modalresult:=mrOk;
  end;

 

Link to comment
Share on other sites

10 minutes ago, Roberto Nicchi said:

Ok, only now i have realized that there's a showmask property in the Tunibutton :)

It works fine BUT, if in the button onclick event a messagedlg method is executed, the mask is not visualized. Is it WAD ?

thanks

I was folgorated by an idea. Maybe I have to make the request for confirmation with JS code ? If this is correct could anyone tell me how? Unfortunately my knowledge of JS is zero.

Link to comment
Share on other sites

Ok i have the solution. See below. Let me know if there's another (better/faster) solution.

In the button have defined the JS event click (in Extevents)

 

function click(sender, e, eOpts)
{
  if (confirm("Confermation request")==true)
    ajaxRequest(sender, '_doit', []);  
}

 

in the button have definied the onajaxevent event

 

  if EventName = '_doit' then
  begin
    modalresult:=mrOk;
  end;
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...