Mega Code Archive

 
Categories / Delphi / LAN Web TCP
 

IntraWeb short introduction

Title: IntraWeb - short introduction Question: With Delphi 7 there is a new technology included in the Professional package and above. IntraWeb from AtoZed software is a simple way of providing HTML creating within Delphi and without the slightest knowledge of HTML or any similar stuff. Answer: 1st Note Although I have selected (Delphi 6 or higher) as option for this source, this sample is using the IntraWeb components available with Delphi 7, only. Anyway you may use earlier versions of Delphi when licensing the IntraWeb components separatly from AtoZed. 2nd Note There is no code to this article, as the is no need for coding at all. It is a simple click-and-run procedure. What is this good for Certainly, I would not recommend this technology for Interet applications, as I think, it is a little to unfelxible for the Internet. However, as the name "IntraWeb" suggests already, it is a good choice for IntraNet applications. The IntraWeb components delivered with Delphi 7 make HTML developing within Delphi an easy task. You place the IntraWeb Components on a special IntraWeb form. The "black box" behind this technology will create the HTML Source code needed to present the form to every standard web browser. Let's get started Currentyl, I have simply played around with this technology by looking at the samples and tried a little myself. So, therefore I would not call myself an expert on this technology, however, they made so easy to understand, that I feel confident giving you a short introduction - let's start! First, we start a new project File | New | Other... On the IntraWeb tab sheet you'll find the option Stand Alone Application with Data Module. Upon selecting this option you will get a dialog asking for a directory for the Application. There is the first "bad" part. This wizard will save all the files with given default names. Afterwards most of you, like I do, will rename the files to fit the companies guide lines. But this wont stop us now, exploring the system. Preparing the Data Module So, first we want to prepare our web server for the database. Simply drop a TTable component on the form and name it tblFishy. Set the DatabaseName property to DBDEMOS and select as TableName the animals.dbf option. Now drop a TDataSource component on the form, name it dsFishy and connect it with tblFishy. Lets do no HTML Switch to the "HTML" Form named TformMain, unit IWUnit1 by default. Now, go to the second uses clause and insert the unit DatamoduleUnit to it. That's in fact the only coding we need to do here! To the form add two TIWLabel components from the IW Standard tab. Set their captions to Name and Weight. From the IW Data tab add two TIWDBEdit, a TIWDBImage, and a TIWDBNavigator. Connect each of the to the data source from our data module and the edit controls and the image to their respective fields. That's it, already Now simply hit the F9 button to compile and run your project. Next you will see a form, we did not even know about, until now. This is the web server hosting our first IntraWeb module. The first button on it will start your default web browser and open the web form, you have just created. Now you can simply surf through the database and edit the records as you wish. If you are lucky and have a license of Delphi 7 Enterprise or Architect, IntraWeb offers automatic session management for your applications. One tiddy details less to worry about. Have fun and good luck. Daniel Wischnewski