Creating the SSCA Master application  Creating the SSCA Employee application

Chapter 3: Creating a Multipage Mobile Application

Creating the SSCA Department application

This procedure describes how to define the drill-down application named SSCA Department. This application displays the employees in a department. The application uses an @OP tag to dynamically select rows from the database to replace the Dept Name parameter. See “Using the @OP tag to insert parameters” for information.

StepsDefining the SSCA Department application

  1. In Mobile Web Studio, select Applications from the Build menu in the left pane, select New under Application Manager, and click the New button to launch Application Builder.

  2. Click the down-arrow to the right of Add, and select Database Element.

  3. In the Database Elements Definition window, enter JDBC connection information needed for the application to access a database and extract specific database information.

    The values in the following example assume that the database included with Mobile Web Studio—sampledb—has been started and that it is accessible on port 4747.

    1. Click the JDBC URL option button.

    2. Complete these options:

      • Username – enter dba, which is the user name used to access the database.

      • Password – enter SQL, which is the password used to access the database.

      • JDBC Connect URL – enter the URL used by JDBC to connect to the database:

        jdbc:sybase:Tds:localhost:4747?ServiceName=
        sampledb
        
      • JDBC driver – enter the JDBC driver used to connect to the database, in this case:

        com.sybase.jdbc2.jdbc.SybDriver
        
      • SQL Query String – enter the following SQL code to select department heads for each department from sambledb:

        select e.emp_fname + ' ' + e.emp_lname as Employee from employee e, department d where e.dept_id = d.dept_id and '@OP["Dept Name"="Shipping"]' = d.dept_name
        

        Notice the use of the @OP tag. This indicates that the application uses a parameter (Dept Name) to replace the tag at run time. If the parameter is not defined, the @OP tag will be replaced by the default value, Shipping. This ensures that previews, where parameters may not be explicitly defined, result in some valid data being returned.

        NoteWhen you create an application with input parameters, you must define a default value to register as click-across event listeners.

      • UI XSLT – leave this field empty.

  4. Click Preview. A one column table showing Employee displays in the Preview panel.

    Employee

    Jeannette Bertrand

    Jose Martinez

    Jane Braun

    Felicia Kuo

    Charles Crowley

    Joseph Barker

    Anthony Rebeiro

    Sheila Romero

    Michael Lynch

  5. Click Next. The Split window displays.

  6. Click Next. The Define window displays.

  7. On the Define window displays, identify record 1 as the header row. In the Define Record Layout section:

  8. Click Next. The parameter definition window displays with a list of parameters.

  9. On the parameter definition window, specify “shipping” as the default Department Name for the @OP tag, and define Dept Name as the default value. Accept the defaults including:

  10. Click Next. The Window Preview displays.

  11. In Element Name, enter SSCA Department as the element name. Under Window Preview, notice the grid showing Employee.

    Click Next.

  12. In the Continuous Capture Page window, click Finish.

  13. When you return to the Application Builder, click Save.

  14. In the Finish window, make this change (otherwise accept the defaults):

    Content tab

  15. Click Finish to create the application.

  16. Click OK to confirm.

  17. Click Close to exit the Application Builder.

  18. In Mobile Web Studio, approve the application:

  19. Select Approved from the Application Manager Status menu. You see your newly approved SSCA Department application in the detail pane.





Copyright © 2005. Sybase Inc. All rights reserved. Creating the SSCA Employee application

View this book as PDF