Using IntraWeb with Web Broker

From RAD Studio
Jump to: navigation, search

Go Up to Using IntraWeb (VCL for the Web) Index


IntraWeb is a powerful tool for developing Web server applications all by itself. Still, there are some things it can't do alone, like create CGI applications. For CGI, you can use Web Broker. Also, you may have existing Web Broker applications that you want to extend but not rewrite. You can still take advantage of IntraWeb's design tools by using IntraWeb forms and components in Web Broker projects. You can use IntraWeb to create individual pages instead of entire applications.

To create Web pages using IntraWeb tools, use the following steps:

  1. Create or open a Web Broker application, and drop a WebDispatcher component on your Web module (Web Broker). The WebDispatcher component is on the Internet tab of the Tool Palette.
  2. Drop an IWModuleController component on your Web module (Web Broker). IWModuleController is on the IW Control category of the Tool Palette.
  3. Remove any existing page producer components from your Web module (Web Broker).
  4. Drop an IWPageProducer component on your Web module.
  5. Select File > New > Other > IntraWeb > Page Form to create a new IntraWeb page form.
  6. Add an OnGetForm event handler by double-clicking the IWPageProducer component on your Web module or Web page module. A new method will appear in the editor window.
  7. Connect the IntraWeb form to the Web module or Web page module by adding a line of code to your OnGetForm event handler.
    The code line should be similar to, or identical to, the following:
    • VForm := TformMain.Create(AWebApplication); (Delphi)
    • VForm = TformMain->Create(AWebApplication); (C++)
  8. If necessary, change TformMain to the name of your IntraWeb form class. To find the form class name, click on the form. Its name appears next to the form window name in the Object Inspector.
  9. In the unit file where you changed the event handler, add IWApplication and IWPageForm to the uses clause. Also, add the unit containing your form.

See Also