Creating the SSCADepartment application

This procedure describes how to define the drill-down application named SSCADepartment. 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 SSCADepartment 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.

    This example uses sampledb 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 sampledb:

        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 runtime. If the parameter is not defined, the @OP tag is 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 Define window displays.

  6. On the Define window, identify record 1 as the header row. In the Define Record Layout section, click “Record Contains Labels,” accept the default, 1, and click Next.

  7. On the Filter window, click Next. The Configure Parameters window displays with a list of parameters.

  8. On the Configure Parameters window, specify “Shipping” as the default Department Name for the @OP tag, and define Dept Name as the default value. Accept the defaults including:

    Click Next.

  9. The Window Preview displays. In Element Name, enter SSCADepartment. Under Window Preview, notice the grid showing Employee.

    Click Finish.

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

  11. In the Finish window, accept the defaults, and click Finish to save the application.

  12. Click OK to confirm.

  13. Click Close to exit the Application Builder.

  14. In Mobile Web Studio, approve the application:

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