Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - M-Business Anywhere Programming » Tutorial: A Sample Application for M-Business Anywhere

Lesson 5: Add inserts to your application Next Page

Lesson 6: Add navigation to your application


This lesson describes code for scrolling forward and backward through the rows of a result set.

Add navigation code to your application
  1. Add the MoveNext function to tutorial.js, immediately after the Insert function:

    function MoveNext()
    {
      if( ! CustomerTable.moveNext() ) {
        CustomerTable.moveLast();
      }
    }
  2. Add the MovePrev function to tutorial.js, immediately after the MoveNext function:

    function MovePrev()
    {
      if( ! CustomerTable.movePrevious() ) {
        CustomerTable.moveFirst();
      }
    }
  3. Add the following procedures to main.html:

    function ClickNext()
    {
      MoveNext();
      DisplayCurrentRow();
    }
    function ClickPrev()
    {
      MovePrev();
      DisplayCurrentRow();
    }
  4. Synchronize your application and test the navigation buttons.

    When the form is first displayed, the controls are empty as the current position is before the first row. After the form is displayed, click Next and Previous to move through the rows of the table.