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 need Web Broker or WebSnap. Also, you may have existing Web Broker and WebSnap 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 or WebSnap projects. You can use IntraWeb to create individual pages instead of entire applications.
To create Web pages using IntraWeb tools, use the following steps:
- Create or open a Web Broker or WebSnap application, and drop a WebDispatcher component on your Web module (Web Broker) or Web application module (WebSnap). The WebDispatcher component is on the Internet tab of the Tool palette.
- Drop an IWModuleController component on your Web module (Web Broker) or Web application module (WebSnap). IWModuleController is on the IW Control category of the Tool palette.
- In WebSnap applications, create a new Web page module if necessary. In the New WebSnap Page dialog, uncheck the New File box in the HTML section before continuing.
Note: If you create a page module with the New File box checked, you can change the result later. Open the page module's unit file in the editor. Next, change '.html' to an empty string (") in the WebRequestHandler.AddWebModuleFactory call at the bottom of the unit.
- Remove any existing page producer components from your Web module (Web Broker) or Web page module (WebSnap).
- Drop an IWPageProducer component on your Web module or Web page module.
- Select FileNewOtherIntraWebPage Form to create a new IntraWeb page form.
- 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.
- 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, if not identical to, the following:
VForm := TformMain.Create(AWebApplication);
VForm = TformMain->Create(AWebApplication);
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.
- 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.