- Transforming a page in Session mode into an AWP page
- Programming tips
- Useful to know
- Limitations regarding the content and the programming of AWP pages
- Displaying an AWP page
- Installing the AWP pages on a server
Creating and distributing AWP pages
Transforming a page in Session mode into an AWP page
To transform a page in Session mode into an AWP page:
- Open the description of the current page ("Description" in the page popup menu).
- In the "General" tab, in "Type of page", select "AWP".
Where will the AWP page be saved?
Once a dynamic page has been transformed into an AWP page, the page will be generated in AWP format in the <Project Name>_WEB directory of the project (in each subdirectory corresponding to the languages supported by the project).
- The server code must be found in the initialization events (initialization of page or controls).
- The contexts must be managed by programming. The page must be positioned in the database (according to the parameters received in the URL for example). See Displaying an AWP page from another page for more details.
- Refreshing an AWP page: Refreshing an AWP page triggers all WLanguage events in the page. For example, if the AWP page allowed for an addition, refreshing the page will make that addition again.
- WLanguage events: The order of execution of WLanguage events when clicking on a Button control, for example, is as follows:
- "Initializing" event of the project,
- "Global declarations" event of the page,
- "Initializing" event of the controls in the page,
- "Initializing" event of the page,
- "Click" event of the clicked Button control
Whenever an action is performed in the AWP page, the corresponding HTML page is entirely rebuilt on the server.
- Links: The links can be built by programming (URL used on Link controls).
- Links and buttons: You should prefer the links and buttons without "submit". A "<a href>" link is generated in the page.
Limitations regarding the content and the programming of AWP pages
- First page of a project: An AWP page cannot be the first page of the project in Session mode. An AWP page can be the home page of a project.
- WLanguage trace functions: Only the output into a file is available (trFile constant).
- Dialog boxes: The dialog boxes displayed by Confirm, Error and Info are ignored if a page is displayed in the same process by PageDisplay.
- Global elements used in the project: When modifying an element global to the project (global procedure, query, class, ...), the project must be recompiled in order to take these modifications into account in the relevant stand-alone AWP pages.
- Pagers: The pagers generated by RAD cannot be used in the AWP pages. Indeed, these controls use the project context (that does not exist in the AWP pages). These controls must be replaced by a programmed pager. Each link of the pager must display a page with specific data (page based on a query with parameters for instance).
All the records can also be displayed in a cell with scrollbar.
Versions 16 and later
- Table control: The Table controls are limited (the browsing tables with Link columns do not operate anymore for example). They can be replaced by a looper (whose links are dynamically created by Url).
- Image control: No generated image can be used in the AWP pages.
- Element in memory (list box, combo box, looper): The content of these elements is volatile. The content of these elements should be systematically filled in the initialization code of the page.
- The value of the read-only controls is lost and it must be recalculated whenever the page is displayed.
- Size of AWP pages: With large projects (containing several classes, global procedures or queries), the size of the generated AWP pages will be quite important.
- Global server variables: The global server variables of the project regain their default value whenever the page is accessed in case of stand-alone AWP pages. However, you can use DeclareAWPContext or hidden controls associated with the desired value.
- WINDEV or WEBDEV components: The components handled by an AWP page are not found. They must be moved to the <ProjectName>_WEB directory.
- Location of data files: The location of data files must be performed in the initialization code of project, via the following code line for example:
- Relative URL: The relative URLs created by programming in the home page of project must not be used.
An AWP page can be displayed from a static page or from a dynamic page of a WEBDEV site.
An AWP page can be displayed:
- from the WEBDEV interface: all you have to do is select the AWP page to display when describing the link.
- by programming.
Installing the AWP pages on a server
To install AWP pages on a server, you can:
- use the standard setup of a site in Session mode. The AWP files are classified in the "Static HTML files" category.
- use WDDeploy or any other FTP client to install the file directly on the desired site.
Click [Add] to post a comment