PreTransactionEvent sender, CEWebFormRendererEventArgs

The PreTransaction Event is raised before the CE Web Form Renderer calls the CE Transaction() method to send data to the host.

If intercepted, the programmer of the hosting page can access the Session and Status objects, and manipulate the data, for example to check the data the user has just entered, change that data if required, send one or more transactions to the host, etc.

The normal processing of the CE Web Form Renderer can be altered by setting properties on the CEWebFormRendererEventArgs object.

By setting the CancelFormRendering property of the CEWebFormRendererEventArgs to true, the programmer of the hosting page can stop the CE Web Form Renderer processing, and can take control of all processing.

By setting the BypassTransaction property of the CEWebFormRendererEventArgs to true, the programmer of the hosting page can tell the CE Web Form Renderer to skip the actual call to the CE Transaction() method, and to continue processing as if the CurrentIspec and Status objects have been returned from the host. (that is, the programmer of the hosting page has manipulated the data in some way, and wants the CE Web Form Renderer to show the resulting form.)

Note: If the programmer of the hosting page bypasses the transaction() method by setting BypassTransaction property to true, the PostTransactionEvent is NOT raised.

If the programmer of the hosting page bypasses the transaction method, the ReturnCode of the CEWebFormRendererEventArgs should be set to an appropriate value. Refer to the CEWindowsAPI.ResponseCodes class for values to use.

In General, this is ResponseCodes.OK for an ok.

By setting/leaving both values as false, the CE Web Form Renderer carries on processing as normal, that is, transmitting any new data the programmer of the hosting page might have altered, to the host.

Example hosting page PreTransaction event handler. (C#)

private void OnPreTransaction(object sender, CEWebForm.CEWebFormRendererEventArgs e)
CEWindowsAPI.IspecModel currIspec = e.HostSession.GetCurrentIspec();
      if (currIspec.GetFieldValue("ACTION") == "DRT231")
            currIspec.SetFieldValue("ACTION") == "DRT123";