This Ajax overload:
function TExtObject.Ajax(MethodName : string; Params : array of const; IsEvent
: boolean = false) : TExtFunction;
does not add the Obj parameter to the generated JS code, unless IsEvent is True.
It is useful, at times, to call this method on an instance with a computed
(i.e. not fixed) method name, so I propose that the Obj param is always added:
function TExtObject.Ajax(MethodName : string; Params : array of const; IsEvent
: boolean = false) : TExtFunction;
var
lParams : string;
begin
InJSFunction := false;
Result := TExtFunction(Self);
lParams := IfThen(JSName = '', '', 'Obj=' + JSName);
if IsEvent then begin
lParams := lParams + '&IsEvent=1&Evt=' + MethodName;
MethodName := 'HandleEvent';
end;
AjaxCode(MethodName, lParams, Params);
end;
Note: this version also fixes a glitch in which an extra & (resulting in an
empty param) was being put in the generated code.
Original issue reported on code.google.com by nando.dessena on 11 Aug 2011 at 4:33
Original issue reported on code.google.com by
nando.dessena
on 11 Aug 2011 at 4:33