Page Parameters

Use a page parameter when the value for the retrieval argument is specified on another page. You can add page parameters on the Parameters tab page of the Page Properties dialog box. The parameters you specify automatically appear in the Bind Value drop-down list on the Retrieval tab of the Sybase Web DataWindow DTC Properties dialog box when you select Page Parameters as the bind type.

For 4GL Web pages When the linking page is 4GL enabled, the Web Target user interface lets you specify parameters (and variables, expressions, and so on) to pass to the target page using different navigation styles: Hyperlink, Form Submit, or Server Redirect. After you link these values to parameters that you specify on a target page containing a Web DataWindow, you can select the parameters from the Bind Value drop-down list to bind them to your retrieval arguments.

For more information on navigation styles for 4GL pages, see Chapter 10, “Setting Up Page Navigation.”

For non-4GL Web pages When the linking page is not 4GL enabled, you can use the Hyperlink or the Form Submit navigation styles, but you must manually edit or verify the source code rather than rely on the Web Target user interface to generate this for you. The following table shows the tasks required on the linking page to submit a value as a parameter for a retrieval argument on the target page.

Table 11-2: Using a parameter from a non-4GL linking page as a retrieval argument

Navigation style

Tasks on linking page

Hyperlink

Set HREF attribute for the A element to the target URL. Append a page parameter to the URL using a query string.

Form Submit

Make sure all controls (whose values you want to bind to the retrieval argument on a target page) are wrapped in a FORM element. Set the ACTION attribute of the FORM element to the target URL.

On the Retrieval tab of the Sybase Web DataWindow DTC (in the target page), select Page Parameter as the bind type and type in the parameters you are passing in the Bind Value column. The parameters you type must match the parameters you submit from the linking page.

For more information about page parameters, see “Managing page data”.

Example 1

Example 3

Setting up and using a page parameter In this example, the user selects a state and views a list of employees in that state. Two Web pages are involved: the linking page has a form for selecting the state and the target page has a Web DataWindow DTC. This example demonstrates one way to pass page parameters from a linking page that is not 4GL enabled.

The first page, Empstate.htm, includes this form:

<FORM id=FORM1 name=EmployeeState action="emplist.htm"
   method=post>     
Choose a state:
  <SELECT id=SELECT1 name=State size=3>	
      <OPTION value=MA>Massachusetts      
      <OPTION value=CA>California 	
      <OPTION value=TX>Texas
  </SELECT> 
<INPUT value=Go id=INPUT1 name=Submit type=submit>
</FORM> 

When the user clicks the button labeled Go, the target page Emplist.htm displays. Emplist.htm has two page parameters with names that match the two form fields: State and Submit.

In the Web DataWindow DTC, the DataWindow object has a retrieval argument called state. On the Retrieval tab of the Properties dialog box, you make the connection between the state retrieval argument, which is listed automatically, and the State page parameter.

The names of the form field and the target page parameter must match in capitalization. In the form above, the NAME attribute of the SELECT element is State; therefore, the page parameter name in the Bind Value column must also be State, with the same capitalization.

The sample shows the Retrieval page of the Sybase Web DataWindow DTC Properties dialog box. At top is a selected check box for Automatic Retrieval, then a display labeled Retrieval Arguments with columns for Argument Name, Bind Type, and Bind Value and one sample entry that reads state, Page Parameter, and State.

Example 2

Page parameters passed from <A> elements An alternative to the Form Submit method is a list of hyperlinks. On the linking page Empstate.htm, several HTML anchor elements could include a query string as part of the target URL. In each anchor element, the query string assigns a different value to the name State.

<LI><A id=A1 href="emplist.htm?State=MA">
       Massachusetts</A></LI>
<LI><A id=A2 href="emplist.htm?State=CA">
       California</A></LI>
<LI><A id=A3 href="emplist.htm?State=TX"> 
       Texas</A></LI>