Up
 
 

Easy Rules for Success with WebHub

RULE #1. Some components go in every project.

Regardless of what kind of web application you are building, some components are always included. Those are:

RULE #2. The only other component you have to learn is TWebAction.

TWebAction is a component, and the base class for almost all the other special-purpose components in WebHub.

The two important things about TWebAction are:

  • save-state is built in so when you are ready for that, it's ready.
  • you can call the component by name from WebHub-HTML e.g. %=webaction1.execute=%

    Can you pass parameters? Yes!

    %=webaction1.execute|aparameter,anotherParameter,etcParameter=%

    If you open the webhub.hlp file and go to the CONTENTS page, you will find links with information on setting up your first project and getting HTML like this going. It's a bit different from crafting regular static HTML pages.

    RULE #3. The only method you really have to learn is Send().

    Public 
    procedure Send(Const Text:String); 
    
    Applies to TWebBasicOutput 
    
    Description: Sends string to the output document which is sent to the surfer. 
    
    Send() is the easiest way to send dynamic HTML to the web. EVERYTHING ELSE IS TAKEN CARE OF FOR YOU BY WEBHUB.

    NO KIDDING.

    An Example Using the Send Method

    This is the sort of thing you would do. You customize the OnExecute method of the WebAction component. Whatever code you write will execute when that component is called by name from the HTML.
    procedure TForm1.WebAction1Execute(Sender: TObject);
    begin
      with TWebAction(Sender) do begin
        with WebOutput do begin
          Send('Hello');            // hello there
          Send('<h2>Hello</h2>');   // same thing, in a header
          SendComment('Hello?');    // sends an HTML comment
          Send('%=pageHeader=%');   // sends the contents of a WebHub "chunk" named pageHeader
          end;
        end;
    end;
    
    As you can see, the ability to send strings to a web page is pretty basic and pretty powerful. Especially when you have the entire WebHub framework supporting you.

    You won't have to learn about DLLs or ISAPI or NSAPI or cgi details. All you have to do is use Delphi and WebHub.

    After you've done a few pages like this, you can branch out to use the other TWebAction components for assistance with database grids and a whole lot more. But for starters, this is all you need to know.

     
     

    Copyright (c) 1995-1997 HREF Tools Corp. All Rights Reserved.
    [ info@href.com ] [ catalog@mail.href.com ] [ webhubsales@href.com ]
    Last generated: Mon 13 Oct 1997 06:19:37 GMT