Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IWCallBackFunc Bug IW 15.1.4
#1
IW is trying to clear an uncreated object, Add Lines commented below //OPH20190826 Prevent Bug


unit IWCallBackFunc;
//OPH20190826 Prevent Bug

interface

...

implementation

...

procedure TIWCallBacks.Invoke(ACallbackRec: TIWCallbackRec);
var
  LResult: string;
  LHandled: Boolean;
  LForm: TIWForm;
  LSession: TIWApplicationAccess;
begin
  LSession := TIWApplicationAccess(FSession);
  if not Assigned(LSession) or not Assigned(LSession.ActiveForm) then begin
    Exit;
  end;

  LForm := TIWForm(LSession.ActiveForm);
  try
    //Pass a copy of all Request params to the Callback.
    if not Assigned(FEventParams) then begin
      FEventParams := TIWStringList.Create;
    end;
    FEventParams.AddStrings(LForm.Params, False);
    if Assigned(ACallbackRec.Method) then begin
      ACallbackRec.Method(FEventParams);
    end else if Assigned(ACallbackRec.Proc) then begin
      LResult := '';
      LHandled := False;
      ACallbackRec.Proc(FEventParams, LResult, LHandled);
      if LHandled then begin    // user code handles the response
        LSession.CallBackResponse.SendResponse := False;
        Exit;
      end;
      if LResult <> '' then begin
        // Write result to response as is
        LSession.CallBackResponse.AddRawText(LResult);
      end;
    end;
    if LForm.SendAJAXNotification then begin
      LSession.CallBackResponse.AddJavaScriptToExecute(LForm.GetIWAJAXNotificationJSCode);
    end;
  finally
    if Assigned(FEventParams) then //OPH20190826 Prevent Bug
      FEventParams.Clear;
  end;
end;

...
Reply


Messages In This Thread
IWCallBackFunc Bug IW 15.1.4 - by omarperezh - 08-28-2019, 06:06 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)