Jump to content

JavaScript Event-> UniGui Event


Aggie85

Recommended Posts

Howdy All!

I hope I explain this clear enough.

I have been playing with a version of a Progress-Stepper component I wrapped into an Intraweb Bootstrap component. 

From my little experimenting, the same approach will work with UniGui (create the stepper HTML and output as raw HTML to a TUniLabel).

The issue I have is that I add a javascript OnClick event handler on the labels of the finished steps. If the user clicks on a stepper label with an active event, my javascript event gets called and I want to do an AJAX call to a C++ Builder event on the server with the ID of the label clicked. Intraweb has a javascript function called executeAjaxEvent() that allows this.

So, my questions are:

1) How / where do I add my JavaScript event handler (in IW, there is a form property called JavaScript).

2) And from my JavaScript event, how do I make an ajax call to a c++ method on the server?

Thanks in advance,

Aggie85

Link to comment
Share on other sites

i hope - i understand your question:

 

in Javascript - i use this to send infos to my delphi code:

ajaxRequest(MainForm.form,''News'' , [''param0=par1'' , ''param1=par2'' ])

 

in Delphi - i use this code to read the values

procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);

var
  parameter_0: String;
  parameter_1: String;

begin

  parameter_0 := '';
  parameter_1 := '';


  parameter_0 := Params.Values['param0'];
  parameter_1 := Params.Values['param1'];


  if EventName = 'News' then
  begin

 

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