Collection Contents 上一页 下一页 PDF

UltraLite for M-Business Anywhere User's Guide

Tutorial: A Sample Application for M-Business Anywhere

Lesson 6: Add navigation to your application


This lesson describes code for scrolling forwards and backwards 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.


Collection Contents 上一页 下一页 PDF