Defining a listener for the cust_id field  Creating an event for employeeSales

Chapter 5: Creating a Multipage Mobile Application with Transaction Support

Creating an employee list

This section shows how to create an employee list application. The employee list shows total sales figures for each sales representatives, using information in sampledb. This will be the master application.

StepsCreating the employee list of sales reps

  1. In Mobile Web Studio, select Applications in the left pane, New in the Application Builder Status menu, and click the New button.

  2. In Application Builder, click the down-arrow to the right of Add, and select Database Element.

  3. On the Database Element Definition window, define the database element:

    1. Make sure the Connection Cache option is selected.

    2. In Conn Cache Name, select sampledb from the drop-down list.

    3. In SQL query string, enter this query:

      set rowcount 10
      select e.emp_id, e.emp_fname, e.emp_lname,
      s.cust_id,  (soi.quantity * p.unit_price) as
      sales_total from employee e, sales_order s,
      sales_order_items soi, product p where e.emp_id
      = s.sales_rep and s.id = soi.id and soi.prod_id
      = p.id and s.region = '@OP["region"="Western"]'
      set rowcount 0
      
    4. Click Preview and make sure these columns are included: emp_id, emp_fname, emp_lname, cust_id, and sales_total.

  4. Click Next. The Split window displays.

  5. Click Next. The Define window displays.

  6. On the Define window, select record 1 as the Label. To do so:

  7. Click Next. The Filter window displays.

  8. Click Next. The parameter definition window displays.

  9. On the parameter definition window, make these modifications (otherwise accept the defaults):

  10. Click Next. The Window Preview window displays.

  11. In Element Name, enter employeeSales.

  12. Click Next. The Continuous Capture window displays.

  13. Click Finish.

  14. Click Save to create the application.

  15. On the Finish window, make these changes (otherwise accept the defaults):

    Content tab Make this entry:

    Click Finish.

  16. Click OK to confirm.

  17. Click Close to close Application Builder.

  18. When you return to the Mobile Web Studio main window, select New from the Application Builder Status menu. The employeeSales application displays in the detail pane.

  19. In Mobile Web Studio, approve the application:

  20. Select Approved from the Application Manager Status menu. You see your newly approved employeeSales application in the detail pane.





Copyright © 2005. Sybase Inc. All rights reserved. Creating an event for employeeSales

View this book as PDF