WEBDEV Concepts

Part 2: Developing a site 47 8 Page contexts 8.1 Overview In a Windows application, the information relative to a window is kept with the window. In a WEBDEV site in Session mode, a page context exists on the server for each page displayed on the browser of the Internet user. The page context contains all the information related to the page: • content of controls, • local variables, • global variables, • WLanguage "server" code, etc. 8.2 Automatic operating mode By default, WEBDEV automatically manages the contexts of pages in Session mode: • A page context is opened when the Session page is displayed in the browser. • The context of a page is updated according to the information the user enters in the browser. The context is updated when the user validates the page (via a "Submit" button or with PageSubmit ). • The existing page contexts are closed when PageUse is used. Then, the page context that corresponds to the page to be displayed with this function is opened. Remark: WEBDEV allows you to perform an advanced management of contexts via the ContextXXX functions. For more details, see the online help. 9 Opening a page in a WEBDEV website 9.1 Overview Several methods can be used to open a new page in a WEBDEV site: • from the description of the control that must open the page (button, link, menu, etc.), • through programming in WLanguage. 9.2 Opening a page from a control description You can set an action and the destination of this action in the description of Button, Link and Image (with clickable area) controls. To open an "xxx" page directly from a Button, Link or Image control: 1. Open the element description ("Description" in the context menu of the element). 2.  In the "Action" area, select the type of action: "Display a site page". 3. Select the page to display. 4. Select the destination of the action: current page, current browser, etc. The previously selected action will be performed in this destination. 5. Finally, indicate if the content of the controls should be sent to the server during the action. 6. Validate. 9.3 Opening a page through programming Several WLanguage functions can be used to open a page. • PageRefresh : Refreshes the page displayed according to its context. • PageDisplay : Opens and displays a new page in the user’s browser. • PageDisplayDialog : Opens and displays a new page modally in the user’s browser. • PageUse : Closes all current pages (and their contexts) and opens a new page. • PopupDisplay : Displays a popup in the page. • PopupDisplayPage : Displays a page as a popup in the page. When the page is opened, you can pass parameters to it. For more details, see the online help. Remark : By default, when a page is opened through programming, the selected destination is: • the destination set in the description of the object that opens the page (Button, Link control, etc.). • the destination set for the current page.

RkJQdWJsaXNoZXIy NDQ0OA==