Creating an application with more features  Chapter 3: Creating a Multipage Mobile Application

Chapter 2: Getting Started

Using the @OP tag to insert parameters

This tutorial introduces you to the basic process of using the @OP tag to insert a parameter. At runtime, the parameter is replaced with the data that you specify. The @OP tag is often used in SQL queries, as it allows an application to use parameterized queries. You can also use the @OP tag for HTML fields.

See the Unwired Accelerator Feature Guide and the Enterprise Portal Development Guide for information about grid rules, and using @OP tags in grid rules, and with HTML.

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

StepsCreating a parameter using the @OP tag

  1. Log in to Mobile Web Studio.

  2. Select Applications in the left pane, and click the New button to launch Application Builder.

  3. In Application Builder, click the down-arrow to the right of Add, and select Database Element. You see the Database Element Definition window.

  4. On the Database Element Definition window:

  5. On the Database Element Definition window, click Next in the top right section of the window.

  6. In the Split window, click Next to continue as we will not use this feature in this tutorial.

  7. Use the Define window to identify record 1 as the header row. In the Define Record Layout section:

  8. On the Filter window, click Next to continue as we will not use this feature in this tutorial. The parameter definition window displays with a list of parameters used to capture the table.

  9. On the parameter definition window:

  10. On Window Preview, enter CompanyAccount (no space).

  11. Click Next.

  12. On the Continuous Capture window, click Finish to complete the New Web Element window. Continuous Capture is not applicable to this tutorial. The New Web Element window closes.

  13. On the Application Builder window, the CompanyAccount application displays in the Element List.

  14. Click Save.

  15. On the Finish window, make this entry (otherwise accept the defaults):

    General tab Name – enter CompanyAccount (no space).

  16. Click the Finish button to save the application.

  17. Click OK to confirm.

  18. In Application Builder, the CompanyAccount application displays in the detail pane.

  19. In Company Name, enter part of a name of any other company or companies in the sample msales database and click Update. For example, enter tech to pull up all account records that have the string “tech” somewhere in the name field. Other examples you can enter include store, oak, health, auto, and corp.

  20. Click Close in the upper right corner to close Application Builder.

  21. In Mobile Web Studio, approve the application:

  22. Select Approved from the Application Manager Status menu. You see the CompanyAccount application in the detail pane.

NoteYou can use multiple @OP tags simultaneously, as shown in this example SQL query that uses two @OP tags to perform a search based on a company name and a state.

select * from account where name like '%@OP["CompanyName"="3Com"]%' and primaryAccountState like '%@OP["State"="CA"]%'

If you use multiple @OP tags, additional parameters appear on the parameter definition window when you create the application.

Remember, when you create an application with input parameters, you must define default values to register as click-across event listeners.





Copyright © 2005. Sybase Inc. All rights reserved. Chapter 3: Creating a Multipage Mobile Application

View this book as PDF