Passing parameters between pagesWeb applications generally consist of multiple pages. Links between pages can be used to pass information from one page to another. This is useful both to make pages more general and to pass specific information between pages, enabling pages to respond to user actions. Information is passed in links using URL query parameters. The syntax for these parameters is URL followed by ?, and then followed by one or more parm=value entries separated by &. A form submit using the GET method will encode form fields as parameters in this way. Example 1 A general page is defined to show announcements. Announcements are in a database and are categorized into one of four categories: events, sales, recreation, and holidays. The general page has a content source with a filter on a field category whose filter is Match Request Parameter "category". Request parameter is a name that refers to either a URL query parameter or a form parameter. An introductory page is also created. It contains four links, each pointing to the general page. Each link has the URL query parameter with a different value. In this example, the general page is used to display different information, and the information displayed is controlled by the URL parameter passed to the page in the link. Example 2 In a phone directory Web application, a search result page gives you a number of entries to choose from. You can click on one of the results to display a detail page about that person. The detail page shows others in the same department. To do this, it needs to have the department ID. Both the person's name or ID and department IS can be passed in the URL link to the detail page using URL query parameters. On the detail page, there is a content source for the person who has a query filter for field person_id with condition Match Request Parameter "id," and there is another content source for departments with a query filter for field department_id with condition Match Request Parameter "dept_id". On the results page, the link to the details page is constructed in the URL editor. To create a link with URL query parameters:
|