Jump to content

Recommended Posts

Posted

 

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?

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

Posted
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;

 

Posted
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?

Posted
10 hours ago, robinhodemorais said:

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

Hello,

Sorry, please clarify your question.

Posted

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?

Posted

tried this way, but the error when applying JS

 

     ScriptJS: = 'ajaxRequest (MainForm.window, "message", ["edit = msg"]);';
         UniSession.AddJS (ScriptJS);

 

Posted

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;

 

Posted

what I'm trying to do now is to trigger a ServerModule event in the Main form, I made several attempts and without success, is there a possibility?

I believe that will end my doubt, thank you.

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