Icon View Incident Report

Serious Serious
Reported By: Peter Olivier
Reported On: 4/4/2021
For: Version 3.00 Build 1
# 4820 Submitting a THTMLForm Using a TServerRequest Component Does Not Work

When posting a THTMLForm to a TEWBModule using a TServerRequest i get an unexpected result.

The Request does not contain FormValues or ContentParts.

The RequestContent however containt a JSON representation of the form.

I've adapted the "UploadFoto" form in the examole "Photo Album" as follows:
(FileUpload is the name of the TEWBModule compiled with Delphi)

Posting the form's submit event is working as expected.

procedure TUploadPhotoDlg.UploadButtonClick(Sender: TObject); 
var
   TempRequest: TServerRequest;
begin
   ErrorLabel.Visible:=False;
   TempRequest:=MainForm.RequestQueue.GetNewRequest;
   with TempRequest do
      begin
      Method := rmPost;
      URL := 'Modules/FileUpload';
      Assign(UploadHTMLForm);
      OnStart:=UploadPhotoRequestStart;
      OnProgress:=UploadPhotoRequestProgress;
      OnComplete:=UploadPhotoRequestComplete;
      end;
   MainForm.RequestQueue.AddRequest(TempRequest);
end;



Comments Comments and Workarounds
The issue was a late addition to EWB 3 that allowed for assignment of a TPersistent descendant class instance to a TServerRequest instance. This additional functionality was overriding the THTMLForm uploading functionality and causing JSON to be sent instead of the form data from the HTML form.

The workaround was to use the normal THTMLForm.Submit method instead of the TServerRequest instance.


Resolution Resolution
Fixed Problem on 4/7/2021 in version 3.01 build 1


Products Affected Products Affected
Elevate Web Builder
Elevate Web Builder Trial

Image