Now you add a DataWindow to an existing Web page. You clear the automatic retrieval check box for this DataWindow. This prevents automatic insertion into your page of the script that accesses the Web DataWindow. You then link a specific DataWindow retrieval argument to a parameter on the Web page and retrieve the DataWindow programmatically.
Open the Product.jsp file.
Place the cursor at the end of the Product Information paragraph and press Enter.
Select Insert>Form Field>DataWindow from the menu bar.
The Sybase Web DataWindow DTC Properties dialog box displays.
Select the Library radio button on the DataWindow page.
Click the browse (...) button next to the DataWindow Library text box.
Select tutor_pb.pbl and click Open.
The path to the tutor_pb.pbl library displays in the Library text box of the Sybase Web DataWindow DTC Properties dialog box.
In the Generate Path In Script group box, select Absolute.
Select d_product from the DataWindow drop-down list box.
An absolute path is used here for the purposes of the tutorial only. In a production environment, you should use a relative path.
Click the Connection tab.
Select EAS Demo DB V105 from the drop-down list box.
Click the Retrieval tab.
Clear the Automatic Retrieval option.
Later you will write a script to retrieve product data during a button Clicked event.
Click the HTML Generator tab.
Select local (your EAServer profile) and click OK.
The d_product Web DataWindow is inserted in the page.
Select the cb_addproduct button in the first drop-down list box in the Script editor.
Select ServerAction() from the second drop-down list box.
Right-click inside the Script editor.
Select Insert Redirect from the drop-down list box.
Click the browse (...) button next to the Destination text box.
Select Addproduct.jsp from the Contents of Customer list box.
You add a link from the Product.jsp page to the Addproduct.jsp page.
Click OK twice.
Select File>Save from the menu bar.