Jump to content

Shoot an ajaxevent to another screen


robinhodemorais

Recommended Posts

 

Hello, can I get a screen to fire an ajaxevent to another screen?

For example user A is on the frmProcessos screen, I want to click on a button to fire an ajaxevent on the MainForm screen or another specific screen, example frmProcessosAndamento, is there such a possibility? if so, how?

Link to comment
Share on other sites

2 hours ago, robinhodemorais said:

can I get a screen to fire an ajaxevent to another screen?

For example user A is on the frmProcessos screen, I want to click on a button to fire an ajaxevent on the MainForm screen or another specific screen, example frmProcessosAndamento, is there such a possibility? if so, how?

Hello,

Please explain...

Link to comment
Share on other sites

2 hours ago, robinhodemorais said:

is there a possibility?

procedure TUniForm1.UniBitBtn1Click(Sender: TObject);
begin
  (Sender as TUniBitBtn).JSInterface.JSCode('ajaxRequest(MainForm.window, "message", ["edit='+ UniEdit1.Text +'"]);');
end;

 

Link to comment
Share on other sites

1 hour ago, Sherzod said:

procedure TUniForm1.UniBitBtn1Click(Sender: TObject);
begin
  (Sender as TUniBitBtn).JSInterface.JSCode('ajaxRequest(MainForm.window, "message", ["edit='+ UniEdit1.Text +'"]);');
end;

 

perfect, just one more detail, can i apply this code in a procedure?
not push the button, but a trigger procedure?

Link to comment
Share on other sites

Oops, I'm sorry, I was forming the idea better, come on, I'm receiving information through the UniGUIServerModuleHTTPDocument and when I receive this information, my idea now is different from this ajax event in the main form, so use the same idea, so the main form doesn't have JSInterface, how to do?

Link to comment
Share on other sites

I set up that way ... but giving error

Access violation at address 007E2DE8 in module 'Project1.exe'. Read of address 00000064

procedure TUniServerModule.UniGUIServerModuleHTTPDocument (
   const Document: string; const InParams: TStrings;
   ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo;
   var Handled: Boolean);
begin
    if ARequestInfo.URI = '/test' then
      begin
         MainForm.WebForm.JSInterface.JSCode ('ajaxRequest (MainForm.window, "message", ["edit = teste"]);');

       end;

end;

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...