This section shows how to create the customer list application. You will create another database element using the same sampledb connection, but with a different query. You will also link the customer list to an update application, and establish a listener for the cust_id field.
Creating the customer list
In Mobile Web Studio, select Applications in the left pane, New in the Application Builder Status menu, and click the New button.
In Application Builder, click the down-arrow to the right of Add, and select Database Element.
On the Database Element Definition window, define the database element:
Make sure the Connection Cache option is selected.
In Conn Cache Name, select sampledb from the drop-down list.
In SQL query string, enter this query:
set rowcount 10 select c.fname as customer_fname , c.lname as customer_lname, si.id, si.prod_id, p.name, si.quantity from customer c, sales_order s, sales_order_items si, product p where c.id = @OP["cust_id"="101"] and s.id = si.id and si.prod_id = p.id and s.region = '@OP["region"="Western"]' set rowcount 0
Click Preview to make sure these columns are included: customer_fname, customer_lname, id, prod_id, name, and quantity.
Click Next. The Split window displays.
Click Next. The Define window displays.
Use the Define window to identify record 1 as the header row. In the Define Record Layout section:
Click “Records contain labels.” The “Labels are displayed in Record” option displays.
Accept the default 1
,
and click Next. The Filter window displays.
Click Next. The parameter definition window displays.
On the parameter definition window, make these modifications (accept the defaults for all others):
region – click the Variable box and make these changes:
Default Value – enter Western,Central
(no
spaces).
Type – choose “Select” from the drop-down list. An Add button appears, which you can ignore.
Personalize – choose “database table” from the drop-down list.
Key – region
displays
as the personalization key (you created the region key in “Creating a personalization key”).
cust_id – click the Variable box and accept the defaults:
Default Value – accept 101
as
the default value for this parameter.
Type – accept “Text Field” from the drop-down list.
Click Next. The Window Preview window displays.
In Element Name, enter customerOrder
(no
spaces).
Click Next. The Continuous Capture window displays.
In the Continuous Capture window, click Finish.
In Application Builder, click Save to save the changes.
In the Finish window, make this change (otherwise accept the defaults):
Name – enter customerOrder
.
Click Finish.
Click OK to confirm.
Click Close to exit the Application Builder.
When you return to the Mobile Web Studio main window, select New from the Application Builder Status menu. The customerOrder application displays in the detail pane.
In Mobile Web Studio, approve the application:
Right-click the customerOrder application in the detail pane, and select Approval Status | Approved.
Click OK to confirm.
Select Approved from the Application Manager Status menu. You see your newly approved customerOrder application in the detail pane.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |