Page 1 of 1

Aparams list POS value

PostPosted: 28 Jun 2017 04:34
by bryl
I need to get the position of the mouse when clicking on a region or dropping another region on the parent region.
The problem is I never get the same information in the aparams list on mouse up event or RegionJQDropOptionsDrop() event.

1 out of 10 times or so I get this (I need it every time to locate the position of the drop or mouse click).
IW_SessionID_=RYwvOmWpbKQeOTayAJBogG IW_TrackID_=2
[color=#FF0000]IWCGJQREGION7_POS=481,101

IWCGJQREGION7_POS=481,101
callback=REGRESTIMESLOT2.DoAjaxRequest
ajaxevent=JQDropOptions.OnDrop
ComponentName=REGResTimeSlot2

Most of the time I get this in the aparams list
IW_SessionID_=RYwvOmWpbKQeOTayAJBogG
IW_TrackID_=2
callback=REGRESTIMESLOT3.DoAjaxRequest
ajaxevent=JQDropOptions.OnDrop
ComponentName=REGResTimeSlot3

To replicate just drop a region with this event ...
procedure TIWForm3.IWCGJQRegion2JQEventsMouseUp(Sender: TObject;
AParams: TStringList);
begin
webapplication.ShowMessage('MouseUp ' + aparams.text);
end;

Can you advise on getting the position every time?

Thanks!
[/color]

Re: Aparams list POS value

PostPosted: 28 Jun 2017 09:50
by Alexander Bulei
Hi bryl,

Please explain me what are you trying to do/handle?

Best Regards.

Re: Aparams list POS value

PostPosted: 30 Jun 2017 09:41
by Alexander Bulei
Hi bryl,

independently from your intention, you can pass the coordenates by using the browser params.

Exemple on button click:

delphi code
procedure TIWForm10.IWAppFormCreate(Sender: TObject);
begin
with IWCGJQButton2.JQButtonOptions.OnClick.BrowserParams.Add do
begin
ServerName:= 'x';
BrowserScript:= 'e.pageX';
end;
with IWCGJQButton2.JQButtonOptions.OnClick.BrowserParams.Add do
begin
ServerName:= 'y';
BrowserScript:= 'e.pageY';
end;
end;

procedure TIWForm10.IWCGJQButton2JQButtonOptionsClick(Sender: TObject; AParams: TStringList);
var
PageX, PageY: Integer;
begin
PageX:= StrToInt( AParams.Values['x']);
PageY:= StrToInt( AParams.Values['y']);
end;


Best Regards.

Re: Aparams list POS value

PostPosted: 12 Jul 2017 04:02
by bryl
Alexander,
Thank you for your reply. I have tried your solution modified for a region.
with IWCGJQRegion7.JQDropOptions.OnDrop.BrowserParams.add do
begin
ServerName:= 'x';
BrowserScript:= 'e.pageX';
end;
with IWCGJQRegion7.JQDropOptions.OnDrop.BrowserParams.add do
begin
ServerName:= 'y';
BrowserScript:= 'e.pageY';
end;
when implemented at create the region drag does not function.

I have attached a form and pas file that explains what I need. You can run it and see that it fails.
Thanks
Bryan

Re: Aparams list POS value

PostPosted: 12 Jul 2017 16:27
by bryl
I found that setting OnDrop.AjaxQueued=true provided accurate X and Y positions.

Re: Aparams list POS value

PostPosted: 13 Jul 2017 11:37
by Alexander Bulei
Hi bryl,

I found that setting OnDrop.AjaxQueued=true provided accurate X and Y positions.


I'm glad that you found the solution :)

Best Regards.