Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
SpeedScript : Building interactive Web pages with embedded SpeedScript : Managing dynamic pages with forms : Building URL query strings and closing out the page
 
Building URL query strings and closing out the page
The final section completes the last DO block by sending out the navigation panel at the end of the Web page:

Part 5 of browse.html

<DIV ALIGN="center"><CENTER>
<TABLE BORDER="2">
  <TR>
    <TD><A
      HREF="‘TmpUrl%20+%20url-field('repo-to','1',DelimiterField)‘"
      onMouseOver="window.status='First ‘{&amp;Result-Rows}‘';return true"
      onMouseOut="window.status='';return true"><IMG
      SRC="/webspeed/images/first-au.gif" BORDER="0" WIDTH="16"
      HEIGHT="16"></A></TD>
    <TD><A
      HREF="‘TmpUrl%20+%20url-field('repo-to',STRING(repo-to%20-%20({&amp;
        result-rows}%20*%202)),DelimiterField)‘"
      onMouseOver="window.status='Prev ‘{&amp;Result-Rows}‘';return true"
      onMouseOut="window.status='';return true"><IMG
      SRC="/webspeed/images/prev-au.gif" BORDER="0" WIDTH="16"
      HEIGHT="16"></A></TD>
    <TD><A
      HREF="‘TmpUrl%20+%20url-field('repo-to',STRING(repo-to),        DelimiterField)‘"
      onMouseOver="window.status='Next ‘{&amp;Result-Rows}‘';return true"
      onMouseOut="window.status='';return true"><IMG
      SRC="/webspeed/images/next-au.gif" BORDER="0" WIDTH="16"
      HEIGHT="16"></A></TD>
    <TD><A
      HREF="‘TmpUrl%20+%20url-field('repo-to','-999',DelimiterField)‘"
      onMouseOver="window.status='Last ‘{&amp;Result-Rows}‘';return true"
      onMouseOut="window.status='';return true"><IMG
      SRC="/webspeed/images/last-au.gif" BORDER="0" WIDTH="16"
      HEIGHT="16"></A></TD>
  </TR>
</TABLE>
</CENTER></DIV><SCRIPT LANGUAGE="SpeedScript">
  END. /* Close of "IF repo-to NE 0 THEN DO:" */
</SCRIPT>
</BODY>
</HTML>
Note that onMouseOver and onMouseOut are JavaScript event handlers.
The navigation panel is built from an HTML table that includes .gif buttons associated with anchors back to this Web object. Each anchor contains a URL query string that specifies how to reconstruct and navigate the most recent query. The query DO block described earlier interprets this information. Note the use of %20 to enter spaces into each embedded SpeedScript expression escape that specifies a URL query string. This is inserted by the authoring tools and specifies the space that is required around SpeedScript string (+) and arithmetic (-) operators used to construct the query string. The embedded SpeedScript preprocessor replaces these with actual spaces in the Web object source code. Finally, a small script section terminates the navigation panel DO block followed by the final HTML tags.
From this description, you can see that an embedded SpeedScript file can generate practically any variety and size of Web page imaginable. In this sense, an embedded SpeedScript Web page can be seen to shrink and expand as it responds to user input and generates database output. With the basic input/output logic written, you can then make any adjustments to account for the server-side realities of Web object execution.