Add a DataWindow to an existing Web page

Note

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.

  1. Open the Product.jsp file.

  2. 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.

  3. Select the Library radio button on the DataWindow page.

    Click the browse (...) button next to the DataWindow Library text box.

  4. 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.

  5. 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.

    Shown is the Data Window tab of the Sigh base Web Data Window D T C Properties dialog box. At top is a Source for H T M L generation group box with radio buttons for Source File ( * dot s r d ), Library ( * dot pibble ), Report ( * dot p s r ), and Web Data Window Container Component. The Library button is selected. Next is a Data Window group box with a Library path, radio buttons for Generate Path in Script with Absolute selected and Relative and No Path unselected, and a Data Window drop down set to d _ product.
  6. Click the Connection tab.

    Select EAS Demo DB V105 from the drop-down list box.

  7. Click the Retrieval tab.

    Clear the Automatic Retrieval option.

    Later you will write a script to retrieve product data during a button Clicked event.

  8. Click the HTML Generator tab.

    Select local (your EAServer profile) and click OK.

    The d_product Web DataWindow is inserted in the page.

  9. 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.

  10. Right-click inside the Script editor.

    Select Insert Redirect from the drop-down list box.

  11. 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.

  12. Click OK twice.

  13. Select File>Save from the menu bar.