Creating an IWP Page
Last Updated: 9/12/2008
|Sections above here:|
Home » Development » Page Mode » IntraWeb Pages
Sections below here:
IWP pages are like normal HTML pages, in fact they are normal HTML pages. The only difference is that optionally they include a special header section and tags for representing controls. This is optional since as mentioned previously, IWP can be dynamic or static. In the latter case, there is no need to add anything other than your normal HTML code.
Here is an example of the HTML source for a static IWP page:
As we can see, there is nothing special about the previous page. This page is returned as is by the IWP application since it is identified as static.
However, the true power of IWP pages is when they return dynamic content that interacts with the server-side PageMode application. When providing dynamic content, you need to add a special header section to the IWP page. This section is enclosed in <IntraWeb:header> tags and currently has two parameters: FormName and Handler. An example of this would be:
The FormName and Handler parameter are not both required. Before explaining what each one does, let us see how IWP pages work. The IWPageController that was dropped on the WebModule when creating the project is the engine behind IWP. It takes care of registering all forms in the project, searching for the correct form when a request comes in and returning the contents, among many other tasks. However, all this is not done by ways of magic! What this component does need to know for each request that is sent to the server is what the corresponding form name or handler is for that page.
If the FormName parameter is specified in the header section, the IWPageController will search the project for the corresponding IWPageForm with the same name and use that for subsequent processing. If the FormName is not specified, it will then look for a Handler. What is a Handler? It is a WebAction.
Although not necessary, IWP allows you to define a webaction to handle a form (page). Like normal PageMode applications, you can define a WebAction that uses a TIWPageProducer to return the contents of the form and perform at the same time other additional actions. However, this is not required and in a way adds an overhead (as far as development time is concerned) when using IWP). You can do it if you specifically require, otherwise, by just specifying the FormName in the header section, you can let IWP take care of all the processing for you.
Therefore, for every dynamic page content you want to add to your website, that has a corresponding IWPageForm (32), add the <IntraWeb:header> section along with the FormName parameter. This tag is transparent to HTML and when the page has been processed and returned to the browser, this section is stripped out.
Creating a dynamic IWP page
The page below is a simple example of an IWP dynamic page, yet is ideal for demonstration purposes. Basically it consists of a static web page with a dynamic label that returns the current date and time. You can use any web page development tool to create this.
The next step is to create the corresponding IWPageForm for this in our project.
(C) 2002-2009 - Atozed Software Ltd.