| Prev | Next
Menu: Products - Portfolio - Services - Download - Order - Company

 
Topic #1.1.1.1.1.
Programmers
   IDE Highlights  
   Web Actions  
*

  

Browsing >>Web Actions: Writing custom web action components

The WebHub class library includes a class called TwhWebActionEx. It is special for two reasons:
  1. Whatever the component does, that action can be triggered from the web simply by calling its name. If the component is called WebMailForm then WebMailForm.execute from a WebHub page will cause the component to execute/run. In the case of WebMailForm, which is included with WebHub, it will send an email message.
  2. Save-state features are included. So even though there might be a thousand people sharing your custom application in an afternoon, each one of them gets to use the component with their own properties set just the way they require. Examples would be: number of search results returned, graphics preferences, or foreign language translation.

Besides giving you the "base class" for TwhWebActionEx, WebHub also gives you a number of derived components for special purposes. By using these components you save yourself anywhere from hours to weeks of work in implementing special purpose features. Here are some popular examples:

  • TwhdbScan - displays a database-driven HTML table, with scrolling and many other features.
  • TwhMailForm - sends email messages including form letters with surfer data "merged" in.
  • TwhPicture - processes BMP to GIF conversions (a separate license is required from Unisys).
  • TwhDropDown - create HTML drop-down boxes that save-state
  • and many more!


Once you learn to program Web Action components, you have unlocked the power of WebHub. Here is a simple HELLO, WORLD example so you can see the syntax. This code goes on the OnExecute event of the TwhWebActionEx component which has been named waHello in this example.
procedure TfmAppSendStr.waHelloExecute(Sender: TObject);
begin
  inherited;
  with TwhWebAction(Sender).Response do 
  begin
    SendHdr('2','Hello, World!');
    Send('The time is '+DateTimeToStr(now));
  end;
end;

 
Path:  www.href.com to; Products to; WebHub to; High Traffic Stats to; Programmers to; Web Actions

Copyright © 1995-2012 HREF Tools Corp. All Rights Reserved Worldwide.
Running: WebHub-v2.167 compiled with d16_win32 on Microsoft-IIS/7.5,
Local Time: Thu, 24 May 2012 03:09:03.
Session 1441632138, 11 pages sent to CCBot/1.0 (+http://www.commoncrawl.org/bot.html) at 38.107.179.229;
Time to produce this page: 0msec.